Created
October 23, 2024 15:50
-
-
Save clementbiron/ec64c1df323e13ad213a702bcc77dcc0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HugoAT01364 < Formula | |
desc "Configurable static site generator" | |
homepage "https://gohugo.io/" | |
url "https://github.com/gohugoio/hugo/archive/v0.136.4.tar.gz" | |
sha256 "839e4545454396d6c6d9a5166151e05fd8f815f36efb2743b9cc7bdb614205f4" | |
license "Apache-2.0" | |
head "https://github.com/gohugoio/hugo.git", branch: "master" | |
depends_on "go" => :build | |
def install | |
ldflags = %W[ | |
-s -w | |
-X github.com/gohugoio/hugo/common/hugo.commitHash=#{tap.user} | |
-X github.com/gohugoio/hugo/common/hugo.buildDate=#{time.iso8601} | |
-X github.com/gohugoio/hugo/common/hugo.vendorInfo=brew | |
] | |
system "go", "build", *std_go_args(ldflags: ldflags), "-tags", "extended", "-o", bin/"hugo", "github.com/gohugoio/hugo" | |
end | |
test do | |
site = testpath/"hops-yeast-malt-water" | |
system "#{bin}/hugo", "new", "site", site | |
assert_predicate testpath/"#{site}/config.toml", :exist? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment