diff --git a/Formula/oapi-cli-git.rb b/Formula/oapi-cli-git.rb new file mode 100644 index 0000000..cff231c --- /dev/null +++ b/Formula/oapi-cli-git.rb @@ -0,0 +1,33 @@ +class OapiCliGit < Formula + desc "Official Outscale CLI providing connectors to Outscale API, nightly version" + homepage "https://github.com/outscale/oapi-cli" + url "https://github.com/outscale/oapi-cli.git" + head "https://github.com/outscale/oapi-cli", branch: "master" + sha256 "" + license "BSD-3-Clause" + version "git" + + conflicts_with "oapi-cli" + depends_on "curl" + depends_on "json-c" + depends_on "cmake" => :build + + + def install + system "git", "submodule", "update", "--init" + system "make" + system "mkdir -p #{prefix}/bin" + system "cp ./oapi-cli #{prefix}/bin/" + system "mkdir -p #{prefix}/contrib/completions/bash/" + system "mkdir -p #{prefix}/contrib/completions/zsh/" + system "cp ./oapi-cli-completion.bash #{prefix}/contrib/completions/bash/" + system "echo autoload bashcompinit > #{prefix}/contrib/completions/zsh/oapi-cli-completion.zsh" + system "echo bashcompinit >> #{prefix}/contrib/completions/zsh/oapi-cli-completion.zsh" + system "echo source #{prefix}/contrib/completions/bash/oapi-cli-completion.bash >> #{prefix}/contrib/completions/zsh/oapi-cli-completion.zsh" + end + + test do + str = shell_output("#{bin}/oapi-cli --help") + assert_match "Usage: oapi-cli [--help] CallName [options] [--Params ParamArgument]", str + end +end diff --git a/Formula/oapi-cli.rb b/Formula/oapi-cli.rb index 6b1d035..33b46ca 100644 --- a/Formula/oapi-cli.rb +++ b/Formula/oapi-cli.rb @@ -1,7 +1,7 @@ class OapiCli < Formula desc "Official Outscale CLI providing connectors to Outscale API" homepage "https://github.com/outscale/oapi-cli" - url "https://github.com/outscale/oapi-cli.git" + url "https://github.com/outscale/oapi-cli.git", tag: "v0.4.0" head "https://github.com/outscale/oapi-cli", branch: "v0.4.0" sha256 "" license "BSD-3-Clause"