homebrew-core/Formula/yarn.rb
Rui Chen 994bccb8d0 yarn 1.21.1
Closes #47727.

Signed-off-by: Alexander Bayandin <a.bayandin@gmail.com>
2019-12-11 18:51:01 +00: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.21.1/yarn-v1.21.1.tar.gz"
sha256 "d1d9f4a0f16f5ed484e814afeb98f39b82d4728c6c8beaafb5abc99c02db6674"
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