Created
February 7, 2026 21:44
-
-
Save singularitti/bc8221e979f28b1c3194efe83b6818ae to your computer and use it in GitHub Desktop.
Update Claude Code Homebrew cask #Julia #Homebrew #Shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Downloads | |
| using Printf | |
| const VERSION = "2.1.37" | |
| const BASE = "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases" | |
| const TARGETS = [ | |
| ("darwin", "arm64"), | |
| ("darwin", "x64"), | |
| ("linux", "x64"), | |
| ("linux", "arm64"), | |
| ] | |
| function sha256_openssl(path::AbstractString)::String | |
| buf = IOBuffer() | |
| run(pipeline(`openssl sha256 $(path)`, stdout=buf, stderr=stderr)) | |
| out = String(take!(buf)) | |
| # Match hash after '=' (ignore spaces) | |
| m = match(r"=\s*([0-9a-fA-F]+)", out) | |
| m === nothing && error("Failed to parse SHA256:\n$out") | |
| return lowercase(m.captures[1]) | |
| end | |
| function download_and_hash(os::String, arch::String; outdir="downloads") | |
| mkpath(outdir) | |
| url = "$(BASE)/$(VERSION)/$(os)-$(arch)/claude" | |
| outfile = joinpath(outdir, @sprintf("claude-%s-%s-v%s", os, arch, VERSION)) | |
| println("Downloading $os / $arch") | |
| Downloads.download(url, outfile) | |
| sha = sha256_openssl(outfile) | |
| println(" sha256: \"$sha\"") | |
| try | |
| chmod(outfile, 0o755) | |
| catch | |
| end | |
| end | |
| function main() | |
| println("Generating SHA256 for Claude Code v$VERSION\n") | |
| for (os, arch) in TARGETS | |
| download_and_hash(os, arch) | |
| end | |
| end | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment