shfmt 3.0.0

Closes #48208.

Signed-off-by: Alexander Bayandin <a.bayandin@gmail.com>
This commit is contained in:
Victor van Poppelen 2019-12-22 18:22:58 -08:00 committed by Alexander Bayandin
parent 3e21e470a7
commit 23224b4564

View file

@ -1,8 +1,8 @@
class Shfmt < Formula class Shfmt < Formula
desc "Autoformat shell script source code" desc "Autoformat shell script source code"
homepage "https://github.com/mvdan/sh" homepage "https://github.com/mvdan/sh"
url "https://github.com/mvdan/sh/archive/v2.6.4.tar.gz" url "https://github.com/mvdan/sh/archive/v3.0.0.tar.gz"
sha256 "72c8e5833e61a31a4595bbd8a77bfb0a8ade9c60603638be70ea801e309d39fe" sha256 "8bfd0d4b4d532d0b6ecd77f94c91d1f6da47b26a4453ed5c7567826113424116"
head "https://github.com/mvdan/sh.git" head "https://github.com/mvdan/sh.git"
bottle do bottle do
@ -16,10 +16,10 @@ class Shfmt < Formula
depends_on "go" => :build depends_on "go" => :build
def install def install
ENV["GOPATH"] = buildpath ENV["CGO_ENABLED"] = "0"
(buildpath/"src/mvdan.cc").mkpath (buildpath/"src/mvdan.cc").mkpath
ln_sf buildpath, buildpath/"src/mvdan.cc/sh" ln_sf buildpath, buildpath/"src/mvdan.cc/sh"
system "go", "build", "-a", "-tags", "production brew", "-o", "#{bin}/shfmt", "mvdan.cc/sh/cmd/shfmt" system "go", "build", "-a", "-tags", "production brew", "-ldflags", "-w -s -extldflags '-static'", "-o", "#{bin}/shfmt", "mvdan.cc/sh/cmd/shfmt"
end end
test do test do