homebrew-core/Formula/adr-tools.rb
haraldme 65d8869965
adr-tools: install bash completion
Closes #35793.

Signed-off-by: Chongyu Zhu <i@lembacon.com>
2019-01-08 18:42:00 +08:00

30 lines
892 B
Ruby

class AdrTools < Formula
desc "CLI tool for working with Architecture Decision Records"
homepage "https://github.com/npryce/adr-tools"
url "https://github.com/npryce/adr-tools/archive/3.0.0.tar.gz"
sha256 "9490f31a457c253c4113313ed6352efcbf8f924970a309a08488833b9c325d7c"
bottle :unneeded
def install
config = buildpath/"src/adr-config"
# Unlink and re-write to matches homebrew's installation conventions
config.unlink
config.write <<~EOS
#!/bin/bash
echo 'adr_bin_dir=\"#{bin}\"'
echo 'adr_template_dir=\"#{prefix}\"'
EOS
prefix.install Dir["src/*.md"]
bin.install Dir["src/*"]
bash_completion.install "autocomplete/adr" => "adr-tools"
end
test do
file = "0001-record-architecture-decisions.md"
assert_match file, shell_output("#{bin}/adr-init")
assert_match file, shell_output("#{bin}/adr-list")
end
end