homebrew-core/Formula/yarn.rb
BePsvPT d990848005 Revert "yarn 1.10.0"
This reverts commit b62019c66b.
2018-09-06 08:16:27 +10:00

25 lines
959 B
Ruby

class Yarn < Formula
desc "JavaScript package manager"
homepage "https://yarnpkg.com/"
url "https://yarnpkg.com/downloads/1.9.4/yarn-v1.9.4.tar.gz"
sha256 "7667eb715077b4bad8e2a832e7084e0e6f1ba54d7280dc573c8f7031a7fb093e"
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, :NPM_CONFIG_PYTHON => "/usr/bin/python"
(bin/"yarnpkg").write_env_script "#{libexec}/bin/yarn.js", :PREFIX => HOMEBREW_PREFIX, :NPM_CONFIG_PYTHON => "/usr/bin/python"
inreplace "#{libexec}/package.json", '"installationMethod": "tar"', '"installationMethod": "homebrew"'
end
test do
(testpath/"package.json").write('{"name": "test"}')
system bin/"yarn", "add", "jquery"
system bin/"yarn", "add", "fsevents", "--build-from-source=true"
end
end