Skip to content

Commit

Permalink
Fix the exit code is 0 when errors happened (#257)
Browse files Browse the repository at this point in the history
* Fix the exit code is 0 when errors happened

* Fix the lint issues
  • Loading branch information
LinuxSuRen committed Apr 1, 2022
1 parent fd5307c commit 57a1d71
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/huandu/xstrings v1.3.2 // indirect
github.com/jenkins-x/go-scm v1.11.1
github.com/linuxsuren/cobra-extension v0.0.11
github.com/linuxsuren/go-cli-alias v0.0.8
github.com/linuxsuren/go-cli-alias v0.0.10
github.com/linuxsuren/http-downloader v0.0.35
github.com/mitchellh/copystructure v1.1.1 // indirect
github.com/rivo/tview v0.0.0-20210923051754-2cb20002bc4c
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ github.com/linuxsuren/cobra-extension v0.0.6/go.mod h1:qcEJv7BbL0UpK6MbrTESP/nKf
github.com/linuxsuren/cobra-extension v0.0.10/go.mod h1:nDsXgvm0lSWVV+byAEfwhIGFDoIp0Sq9wkfNUDBp5do=
github.com/linuxsuren/cobra-extension v0.0.11 h1:Z2Sx8dBPvJK3s3loguFXJtrtiwh1Od3O2xoB6vCOl5M=
github.com/linuxsuren/cobra-extension v0.0.11/go.mod h1:gn69Dtq72JCGZbjW46c14MoE0z/BtDAQWV9Jvr9KczY=
github.com/linuxsuren/go-cli-alias v0.0.8 h1:iTArwDhhrZaXlk9m7ZnvzjHFyguJEJA3uDdCEXt8ccw=
github.com/linuxsuren/go-cli-alias v0.0.8/go.mod h1:g+k4hlbE/lilrEq/5emhMznb9my/lOXSH++/mPli6gw=
github.com/linuxsuren/go-cli-alias v0.0.10 h1:qzaz9RiTVKIWryxw3Hx0q//wjt+VIP+BElgRlSWrDhU=
github.com/linuxsuren/go-cli-alias v0.0.10/go.mod h1:g+k4hlbE/lilrEq/5emhMznb9my/lOXSH++/mPli6gw=
github.com/linuxsuren/http-downloader v0.0.2-0.20201207132639-19888a6beaec/go.mod h1:zRZY9FCDBuYNDxbI2Ny5suasZsMk7J6q9ecQ3V3PIqI=
github.com/linuxsuren/http-downloader v0.0.6/go.mod h1:xxgh2OE7WGL9TwDE9L8Gh7Lqq9fFPuHbh5tofUitEfE=
github.com/linuxsuren/http-downloader v0.0.23/go.mod h1:rUjrcLzC9cAgKSgwEhwDXH5LL0Y/aK5KpTJrA3eqW1s=
Expand Down
1 change: 1 addition & 0 deletions kubectl-plugin/app/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"k8s.io/client-go/kubernetes"
)

// NewAppCmd creates a root command of the application
func NewAppCmd(client dynamic.Interface, clientset *kubernetes.Clientset) (cmd *cobra.Command) {
cmd = &cobra.Command{
Use: "app",
Expand Down
1 change: 1 addition & 0 deletions kubectl-plugin/common/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func ExecCommand(name string, arg ...string) error {
return ExecCommandInDirectory(name, "", arg...)
}

// ExecCommandInDirectory runs a command in a particular directory
func ExecCommandInDirectory(name, dir string, arg ...string) (err error) {
command := exec.Command(name, arg...)
command.Dir = dir
Expand Down

0 comments on commit 57a1d71

Please sign in to comment.