Skip to content

Commit

Permalink
add osc-cost brew package
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-mal committed Oct 10, 2023
1 parent 96cd504 commit daaa0c1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Formula/osc-cost.rb
Original file line number Diff line number Diff line change
@@ -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


0 comments on commit daaa0c1

Please sign in to comment.