bun icon indicating copy to clipboard operation
bun copied to clipboard

Provide a homebrew formula to install Bun

Open davidcelis opened this issue 1 year ago • 1 comments

Thanks for creating Bun! This is probably already on your to-do list for later on in your beta or for when you exit your beta, but it would be great to be able to install bun via homebrew, whether that's a tap or a formula in their core repo.

davidcelis avatar Jul 06 '22 15:07 davidcelis

This worked for me (although I only tried the arm version).

class Bun < Formula

  desc 'bun CLI'
  homepage 'https://bun.sh/'
  version '0.1.10'
  if Hardware::CPU.arm?
    url "https://github.com/oven-sh/bun/releases/download/bun-v#{version}/bun-darwin-aarch64.zip"
    sha256 'f37a77ed4c503540dcfebbd39261b55c9c5ccc5599d8edcf502752949a4b2dbe'
  elsif Hardware::CPU.avx2?
    url "https://github.com/oven-sh/bun/releases/download/bun-v#{version}/bun-darwin-x64.zip"
    sha256 '793ec036acb4a2997aeb1f06c982670f72bb25d94d3f85cca33fef2358d3b541'
  else
    url "https://github.com/oven-sh/bun/releases/download/bun-v#{version}/bun-darwin-x64-baseline.zip"
    sha256 '8dc96c8046127a32da49fc47499cb5cc71bc6bbc9dcc9e0d4eaab7fe0c6f2215'
  end

  def install
    bin.install "bun"
    print "Installed to: #{HOMEBREW_PREFIX}/bin/bun\n"
  end
end

brew install ./bun.rb

jacobtolar avatar Aug 24 '22 16:08 jacobtolar

Homebrew support is finally here 🎉

brew tap oven-sh/bun
brew install bun

You can also install a specific release: (versions 0.1.6 and later)

brew install [email protected]

You can look at our Homebrew tap at this repository: oven-sh/homebrew-bun

Electroid avatar Oct 21 '22 01:10 Electroid