Closes #65163.

Signed-off-by: Dawid Dziurla <dawidd0811@gmail.com>
Signed-off-by: chenrui <chenrui333@gmail.com>
master
guoxudong 2020-11-19 15:09:18 +08:00 committed by chenrui
parent e682a03387
commit 8fd8d63556
1 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,7 @@ class Kubecm < Formula
def install def install
system "go", "build", system "go", "build",
"-ldflags", "-X github.com/sunny0826/kubecm/cmd.kubecmVersion=#{version}", "-ldflags", "-X github.com/sunny0826/kubecm/cmd.kubecmVersion=#{version}",
"-o", bin/"kubecm" *std_go_args
# Install bash completion # Install bash completion
output = Utils.safe_popen_read("#{bin}/kubecm", "completion", "bash") output = Utils.safe_popen_read("#{bin}/kubecm", "completion", "bash")
@ -22,6 +22,8 @@ class Kubecm < Formula
end end
test do test do
assert_match "\nKubeConfig Manager\n", shell_output("#{bin}/kubecm -h 2>&1") # Should error out as switch context need kubeconfig
status_output = shell_output("#{bin}/kubecm switch 2>&1", 1)
assert_match "Error: open", status_output
end end
end end