diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-01-15 22:34:38 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-01-15 22:34:38 +0100 |
commit | d762f4ec9ea35cb00309b41ad60055cd3c5709ba (patch) | |
tree | c246e5b43a1e7b5744e10e75d6ed125629f45936 /go/cmd/gitlab-shell | |
parent | 7215126b6674abd4b5ff6b97d30bab6c544bf8df (diff) | |
download | gitlab-shell-bvl-feature-flag-commands.tar.gz |
Don't fall back to ruby for non SSH connectionsbvl-feature-flag-commands
When SSH_CONNECTION is not set, we don't fall back to ruby, but
instead fail directly in go writing the error to stderr.
Diffstat (limited to 'go/cmd/gitlab-shell')
-rw-r--r-- | go/cmd/gitlab-shell/main.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/go/cmd/gitlab-shell/main.go b/go/cmd/gitlab-shell/main.go index 9e7f2cb..07623b4 100644 --- a/go/cmd/gitlab-shell/main.go +++ b/go/cmd/gitlab-shell/main.go @@ -41,17 +41,16 @@ func main() { cmd, err := command.New(os.Args, config) if err != nil { - // Failed to build the command, fall back to ruby. // For now this could happen if `SSH_CONNECTION` is not set on // the environment - fmt.Fprintf(os.Stderr, "Failed to build command: %v\n", err) - execRuby() + fmt.Fprintf(os.Stderr, "%v\n", err) + os.Exit(1) } // The command will write to STDOUT on execution or replace the current // process in case of the `fallback.Command` if err = cmd.Execute(); err != nil { - fmt.Fprintf(os.Stderr, "%s\n", err) + fmt.Fprintf(os.Stderr, "%v\n", err) os.Exit(1) } } |