homebrew-core/Formula/nuget.rb

31 lines
952 B
Ruby

class Nuget < Formula
desc "Package manager for Microsoft development platform including .NET"
homepage "https://www.nuget.org/"
url "https://dist.nuget.org/win-x86-commandline/v6.4.0/nuget.exe" # make sure libexec.install below matches case
sha256 "26730829b240581a3e6a4e276b9ace088930032df0c680d5591beccf6452374e"
license "MIT"
livecheck do
url "https://dist.nuget.org/tools.json"
regex(%r{"url":\s*?"[^"]+/v?(\d+(?:\.\d+)+)/nuget\.exe",\s*?"stage":\s*?"ReleasedAndBlessed"}i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "bd1dc2993c170db6b5d6e80a21c75c9e96e6fbbb92054ad346a522b4b9caf5ec"
end
depends_on "mono"
def install
libexec.install "nuget.exe" => "nuget.exe"
(bin/"nuget").write <<~EOS
#!/bin/bash
mono #{libexec}/nuget.exe "$@"
EOS
end
test do
assert_match "NuGet.Protocol.Core.v3", shell_output("#{bin}/nuget list packageid:NuGet.Protocol.Core.v3")
end
end