homebrew-core/Formula/yarn.rb

23 lines
728 B
Ruby

class Yarn < Formula
desc "JavaScript package manager"
homepage "https://yarnpkg.com/"
url "https://yarnpkg.com/downloads/0.27.5/yarn-v0.27.5.tar.gz"
sha256 "f0f3510246ee74eb660ea06930dcded7b684eac2593aa979a7add84b72517968"
head "https://github.com/yarnpkg/yarn.git"
bottle :unneeded
depends_on "node" => :recommended
def install
libexec.install Dir["*"]
bin.install_symlink "#{libexec}/bin/yarn.js" => "yarn"
bin.install_symlink "#{libexec}/bin/yarn.js" => "yarnpkg"
inreplace "#{libexec}/package.json", '"installationMethod": "tar"', '"installationMethod": "homebrew"'
end
test do
(testpath/"package.json").write('{"name": "test"}')
system bin/"yarn", "add", "jquery"
end
end