Skip to content

Instantly share code, notes, and snippets.

@chrmoritz
Last active August 16, 2017 14:45
Show Gist options
  • Select an option

  • Save chrmoritz/4047907cdcf43ca7a8153289fe81c3b7 to your computer and use it in GitHub Desktop.

Select an option

Save chrmoritz/4047907cdcf43ca7a8153289fe81c3b7 to your computer and use it in GitHub Desktop.
Homebrew Formula of yarn installing a build of my homebrew-global-prefix (fixing yarn's global prefix)
class Yarn < Formula
desc "JavaScript package manager"
homepage "https://yarnpkg.com/"
url "https://github.com/chrmoritz/yarn/releases/download/v0.28.4/yarn-v0.28.4.tar.gz"
sha256 "de4fbd2b85b4a48bd68f6d1de7a05e54e15cc4a8ea73f2bbaae70bb57a2df2f5"
bottle :unneeded
depends_on "node" => :recommended
def install
libexec.install Dir["*"]
bin.install_symlink "#{libexec}/bin/yarn.js" => "yarn"
bin.install_symlink "#{libexec}/bin/yarn.js" => "yarnpkg"
inreplace "#{libexec}/package.json", '"installationMethod": "unknown"', '"installationMethod": "homebrew"'
end
test do
(testpath/"package.json").write('{"name": "test"}')
system bin/"yarn", "add", "jquery"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment