-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
class BunAT122 < Formula | ||
desc "Incredibly fast JavaScript runtime, bundler, transpiler and package manager - all in one." | ||
homepage "https://bun.sh/" | ||
license "MIT" | ||
version "1.2.2" | ||
|
||
livecheck do | ||
url "https://github.com/oven-sh/bun/releases/latest" | ||
regex(%r{href=.*?/tag/bun-v?(\d+(?:\.\d+)+)["' >]}i) | ||
end | ||
|
||
if OS.mac? | ||
if Hardware::CPU.arm? || Hardware::CPU.in_rosetta2? | ||
url "https://github.com/oven-sh/bun/releases/download/bun-v#{version}/bun-darwin-aarch64.zip" | ||
sha256 "c4d58e06c5c33885b526f4d91a38ca9ebdb9fc3fb4cd547f7d3302055c98e41c" # bun-darwin-aarch64.zip | ||
elsif Hardware::CPU.avx2? | ||
url "https://github.com/oven-sh/bun/releases/download/bun-v#{version}/bun-darwin-x64.zip" | ||
sha256 "2f7d5a9cd90bc4f28449dc7b76a5e9eefade03e119f1cd4e3f941b92b26c6595" # bun-darwin-x64.zip | ||
else | ||
url "https://github.com/oven-sh/bun/releases/download/bun-v#{version}/bun-darwin-x64-baseline.zip" | ||
sha256 "0f3b6e87d862d4016f8d95da177bc9136ca2e950f3d6d3d226a35d7061fff0f1" # bun-darwin-x64-baseline.zip | ||
end | ||
elsif OS.linux? | ||
if Hardware::CPU.arm? | ||
url "https://github.com/oven-sh/bun/releases/download/bun-v#{version}/bun-linux-aarch64.zip" | ||
sha256 "d1dbaa3e9af24549fad92bdbe4fb21fa53302cd048a8f004e85a240984c93d4d" # bun-linux-aarch64.zip | ||
elsif Hardware::CPU.avx2? | ||
url "https://github.com/oven-sh/bun/releases/download/bun-v#{version}/bun-linux-x64.zip" | ||
sha256 "3f4efb8afd1f84ac2a98c04661c898561d1d35527d030cb4571e99b7c85f5079" # bun-linux-x64.zip | ||
else | ||
url "https://github.com/oven-sh/bun/releases/download/bun-v#{version}/bun-linux-x64-baseline.zip" | ||
sha256 "cad7756a6ee16f3432a328f8023fc5cd431106822eacfa6d6d3afbad6fdc24db" # bun-linux-x64-baseline.zip | ||
end | ||
else | ||
odie "Unsupported platform. Please submit a bug report here: https://bun.sh/issues\n#{OS.report}" | ||
end | ||
|
||
# TODO: to become an official formula we need to build from source | ||
def install | ||
bin.install "bun" | ||
ENV["BUN_INSTALL"] = "#{bin}" | ||
generate_completions_from_executable(bin/"bun", "completions") | ||
end | ||
|
||
def test | ||
assert_match "#{version}", shell_output("#{bin}/bun -v") | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ brew install bun | |
If you want to install a specific release, you can include the version in the command. You can also view the list of releases [here](https://github.com/oven-sh/bun/releases). | ||
|
||
```bash | ||
brew install [email protected].1 | ||
brew install [email protected].2 | ||
``` | ||
|
||
## Upgrade | ||
|