Skip to content

Instantly share code, notes, and snippets.

@marcialca
Last active January 24, 2018 23:47
Show Gist options
  • Save marcialca/71905e84b095ec2b088d9f91e09227ef to your computer and use it in GitHub Desktop.
Save marcialca/71905e84b095ec2b088d9f91e09227ef to your computer and use it in GitHub Desktop.
class Yarn < Formula
desc "JavaScript package manager"
homepage "https://yarnpkg.com/"
url "https://github.com/yarnpkg/yarn/archive/v0.28.4.tar.gz"
sha256 "6cfe82e530ef0837212f13e45c1565ba53f5199eec2527b85ecbcd88bf26821d"
bottle :unneeded
depends_on "node" => :recommended
conflicts_with "hadoop", :because => "both install `yarn` binaries"
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