Skip to content

Instantly share code, notes, and snippets.

@chrmoritz
Created November 25, 2017 20:46
Show Gist options
  • Save chrmoritz/a572e5efca056d4dcff43ba376740bed to your computer and use it in GitHub Desktop.
Save chrmoritz/a572e5efca056d4dcff43ba376740bed to your computer and use it in GitHub Desktop.
Homebrew Formula of yarn installing a test build of my homebrew-node-gyp branch
class Yarn < Formula
desc "JavaScript package manager"
homepage "https://yarnpkg.com/"
url "https://github.com/chrmoritz/yarn/releases/download/v1.3.2/yarn-v1.3.2.tar.gz"
sha256 "df9ab3a21ba62ed57fc68c592b4d0000b762739ee4d80566f293187705b6f12b"
revision 42
bottle :unneeded
depends_on "node" => :recommended
def install
libexec.install Dir["*"]
(bin/"yarn").write_env_script "#{libexec}/bin/yarn.js", :PREFIX => HOMEBREW_PREFIX
(bin/"yarnpkg").write_env_script "#{libexec}/bin/yarn.js", :PREFIX => HOMEBREW_PREFIX
inreplace "#{libexec}/package.json", '"installationMethod": "tar"', '"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