homebrew-core/Formula/yarn.rb
BePsvPT b62019c66b yarn 1.10.0
Closes #31841.

Signed-off-by: Jan Viljanen <527069+javian@users.noreply.github.com>
2018-09-05 23:11:38 +02:00

25 lines
961 B
Ruby

class Yarn < Formula
desc "JavaScript package manager"
homepage "https://yarnpkg.com/"
url "https://yarnpkg.com/downloads/1.10.0/yarn-v1.10.0.tar.gz"
sha256 "83277bd505c7f4009c13077266020c97298727de7edf67af5ca66eccae9d4632"
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