Skip to content

Commit

Permalink
HomebrewFormula: latest version of cathtml
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidGamba committed Oct 29, 2024
1 parent 3f1471d commit ac6a77e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions HomebrewFormula/cathtml.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
class Cathtml < Formula
@@tool_name = "cathtml"
@@tool_desc = "Allows concatenating multiple HTML files or portions into a single one"
@@tool_path = "cathtml"

desc "#{@@tool_desc}"
homepage "https://github.com/DavidGamba/dgtools/tree/master/#{@@tool_name}"
url "https://github.com/DavidGamba/dgtools/archive/refs/tags/cathtml/v0.1.0.tar.gz"
sha256 "5774481e3367295c42f445a7206801735d6ae76d322093241476f6e4b473493e"

depends_on "go" => :build

def install
cd "#{@@tool_path}" do
system "go", "get"
system "go", "build"
bin.install "#{@@tool_name}"
end
cd "HomebrewFormula" do
inreplace "completions.bash", "tool", "#{@@tool_name}"
inreplace "completions.zsh", "tool", "#{@@tool_name}"
ohai "Installing bash completion..."
bash_completion.install "completions.bash" => "dgtools.#{@@tool_name}.bash"
ohai %{Installing zsh completion...
To enable zsh completion add this to your ~/.zshrc
\tsource #{zsh_completion.sub prefix, HOMEBREW_PREFIX}/dgtools.#{@@tool_name}.zsh
}
zsh_completion.install "completions.zsh" => "dgtools.#{@@tool_name}.zsh"
ohai "Installed #{@@tool_name} from #{@@tool_path} dir"
end
end

test do
assert_match /Use '#{@@tool_name} help[^']*' for extra details/, shell_output("#{bin}/#{@@tool_name} --help")
end
end

0 comments on commit ac6a77e

Please sign in to comment.