class Hugo < Formula desc "Configurable static site generator" homepage "https://gohugo.io/" url "https://github.com/gohugoio/hugo/archive/v0.60.1.tar.gz" sha256 "5c857cb27a4e1b43477f6775f2b2e870b937e9ebf32f52347ba7fdbde1ee50f7" head "https://github.com/gohugoio/hugo.git" bottle do cellar :any_skip_relocation sha256 "891bfede22375b71d2f2bf97608154773657fee30ced2b8a5037a39083edbc04" => :catalina sha256 "42c2d442620f09272f0342d46020cdd1f3be4277095440e7e9690845bd3e9926" => :mojave sha256 "f3b0d12c08e768ba981c14d25805f7bfd0ff1018f8d80c4158a52912210abcc3" => :high_sierra end depends_on "go" => :build def install ENV["GOPATH"] = HOMEBREW_CACHE/"go_cache" (buildpath/"src/github.com/gohugoio/hugo").install buildpath.children cd "src/github.com/gohugoio/hugo" do system "go", "build", "-o", bin/"hugo", "-tags", "extended", "main.go" # Build bash completion system bin/"hugo", "gen", "autocomplete", "--completionfile=hugo.sh" bash_completion.install "hugo.sh" # Build man pages; target dir man/ is hardcoded :( (Pathname.pwd/"man").mkpath system bin/"hugo", "gen", "man" man1.install Dir["man/*.1"] prefix.install_metafiles end end test do site = testpath/"hops-yeast-malt-water" system "#{bin}/hugo", "new", "site", site assert_predicate testpath/"#{site}/config.toml", :exist? end end