homebrew-core/Formula/yarn.rb
Rui Chen fcda057d02
yarn 1.17.0
Closes #40983.

Signed-off-by: Igor Kapkov <igasgeek@me.com>
2019-06-15 14:13:39 +10:00

26 lines
1 KiB
Ruby

class Yarn < Formula
desc "JavaScript package manager"
homepage "https://yarnpkg.com/"
# Should only be updated if the new version is listed as a stable release on the homepage
url "https://yarnpkg.com/downloads/1.17.0/yarn-v1.17.0.tar.gz"
sha256 "c7ec0f1a2028c0f9a21d27fa1a689b5730d13ddcd3a145f3a2db50ebf98e65cc"
bottle :unneeded
depends_on "node"
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