homebrew-core/Formula/yarn.rb
Christian Moritz e5f703101b yarn: fix node-gyp after python3 -> python rename
Fixes: #24869

Closes #24870.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2018-03-06 11:19:18 -08:00

26 lines
972 B
Ruby

class Yarn < Formula
desc "JavaScript package manager"
homepage "https://yarnpkg.com/"
url "https://yarnpkg.com/downloads/1.5.1/yarn-v1.5.1.tar.gz"
sha256 "cd31657232cf48d57fdbff55f38bfa058d2fb4950450bd34af72dac796af4de1"
revision 1
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