diff --git a/Formula/osc-cost.rb b/Formula/osc-cost.rb new file mode 100644 index 0000000..ed01559 --- /dev/null +++ b/Formula/osc-cost.rb @@ -0,0 +1,31 @@ +class OscCost < Formula + desc "osc-cost allows Outscale users to estimate their cloud costs." + homepage "https://github.com/outscale/osc-cost" + url "https://github.com/outscale/osc-cost/releases/download/v0.3.2/osc-cost-v0.3.2-x86_64-unknown-linux-musl" + sha256 "19251816d6f49ada7e6d371cc38232e29cd6300041df5d01216090b27ee8a0c9" + + license "BSD-3-Clause" + version "0.1.3" + + def install + bin.install "osc-cost" + chmod 0777, "osc-cost" + completions = prefix/"contrib/completions" + bash_completion_file = "contrib/completions/bash/osc-cost-completion.bash" + zsh_completion_file = "#{completions}/zsh/osc-cost-completion.zsh" + system "mkdir -p #{completions}/bash/" + system "mkdir -p #{completions}/zsh/" + system "cp", bash_completion_file, "#{completions}/bash/" if File.exist?(bash_completion_file) + system "sh", "-c", <<~EOS + echo 'autoload bashcompinit' > #{zsh_completion_file} + echo 'bashcompinit' >> #{zsh_completion_file} + echo 'source #{completions}/bash/osc-cost-completion.bash' >> #{zsh_completion_file} + EOS + end + + test do + assert_match "osc-cost", shell_output("#{bin}/osc-cost") + end + end + + \ No newline at end of file