Skip to content

Commit

Permalink
Merge pull request #15 from little-angry-clouds/fix/send_errors_stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
alexppg authored Jun 27, 2020
2 parents 1a6be61 + e3b15ea commit e0adfb4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/helmenv/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Static Tests](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Generic%20tests/badge.svg) ![Int test Linux](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Int%20test%20in%20Linux/badge.svg) ![Int test MacOS](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Integrarion%20test%20in%20MacOS/badge.svg) ![Int test Windows](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Int%20test%20in%20Windows/badge.svg)
![Static Tests](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Generic%20tests/badge.svg) ![Int Test Linux](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Int%20Test%20Linux/badge.svg) ![Int Test MacOS](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Int%20Test%20MacOS/badge.svg) ![Int Test Windows](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Int%20Test%20Windows/badge.svg)

# helmenv
[Helm](https://helm.sh/) version manager inspired by
Expand Down
2 changes: 1 addition & 1 deletion cmd/kbenv/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Static Tests](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Generic%20tests/badge.svg) ![Integration Test in Linux](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Integration%20test%20in%20Linux/badge.svg) ![Integrarion Test in MacOS](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Integrarion%20test%20in%20MacOS/badge.svg) ![Integration Test in Windows](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Integration%20test%20in%20Windows/badge.svg)
![Static Tests](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Generic%20tests/badge.svg) ![Int Test Linux](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Int%20Test%20Linux/badge.svg) ![Int Test MacOS](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Int%20Test%20MacOS/badge.svg) ![Int Test Windows](https://github.com/little-angry-clouds/kubernetes-binaries-managers/workflows/Int%20Test%20Windows/badge.svg)

# kbenv
[Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) version
Expand Down
4 changes: 2 additions & 2 deletions internal/helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func CheckGenericError(err error) {
if err != nil {
message := fmt.Sprintf("An error was detected, exiting: %s", err)
fmt.Println(message)
fmt.Fprintf(os.Stderr, "%s\n", message)
os.Exit(1) // nolint:gomnd
}
}
Expand All @@ -37,7 +37,7 @@ func CheckHTTPError(resp *http.Response) {
message = string(body)
}

fmt.Println("An error detected getting all versions: " + message)
fmt.Fprintf(os.Stderr, "An error detected getting all versions: %s", message)
os.Exit(1) // nolint:gomnd
}
}
Expand Down
7 changes: 2 additions & 5 deletions internal/wrapper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ func Wrapper(binName string) { // nolint: funlen
cmd.Stderr = os.Stderr
err = cmd.Run()

if err != nil {
fmt.Printf("%s\n", err)
os.Exit(1)
}
helpers.CheckGenericError(err)
}

finalVersion = version
Expand All @@ -95,6 +92,6 @@ func Wrapper(binName string) { // nolint: funlen
err = cmd.Run()

if err != nil {
fmt.Printf("%s\n", err)
fmt.Fprintf(os.Stderr, "%s\n", err)
}
}

0 comments on commit e0adfb4

Please sign in to comment.