-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathcf-cli@8.rb
45 lines (41 loc) · 1.34 KB
/
cf-cli@8.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class CfCliAT8 < Formula
desc "Cloud Foundry CLI"
homepage "https://code.cloudfoundry.org/cli"
version "8.9.0"
if OS.mac?
if Hardware::CPU.arm?
url "https://packages.cloudfoundry.org/homebrew?arch=macosarm&version=8.9.0"
sha256 "c1e58a1d404475035b64af4b779492de34f9fa8f80393e022831a64daa236603"
elsif
url "https://packages.cloudfoundry.org/homebrew?arch=macosx64&version=8.9.0"
sha256 "a9afefc82ca225cc5ff619ff01a455a64be2f6012fcfe137ab238f4ebb5529a4"
end
elsif OS.linux?
url "https://packages.cloudfoundry.org/stable?release=linux64-binary&version=8.9.0&source=homebrew"
sha256 "bf18b535512e03a3d939d06dcaee49ff39a0a86ccd8c3d163dd55644c4416df4"
end
def install
bin.install "cf8"
bin.install_symlink "cf8" => "cf"
(bash_completion/"cf8-cli").write <<-completion
# bash completion for Cloud Foundry CLI
_cf-cli() {
# All arguments except the first one
args=("${COMP_WORDS[@]:1:$COMP_CWORD}")
# Only split on newlines
local IFS=$'\n'
# Call completion (note that the first element of COMP_WORDS is
# the executable itself)
COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}"))
return 0
}
complete -F _cf-cli cf8
complete -F _cf-cli cf
completion
doc.install "LICENSE"
doc.install "NOTICE"
end
test do
system "#{bin}/cf8"
end
end