diff options
author | Nick Thomas <nick@gitlab.com> | 2019-10-17 12:04:52 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-10-18 11:47:25 +0100 |
commit | 83d11f4deeb20b852a0af3433190a0f7250a0027 (patch) | |
tree | 1a9df18d6f9f59712c6f5c98e995a4918eb94a11 /go/cmd/gitlab-shell/main.go | |
parent | 7d5229db263a62661653431881bef8b46984d0de (diff) | |
download | gitlab-shell-83d11f4deeb20b852a0af3433190a0f7250a0027.tar.gz |
Move go code up one level
Diffstat (limited to 'go/cmd/gitlab-shell/main.go')
-rw-r--r-- | go/cmd/gitlab-shell/main.go | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/go/cmd/gitlab-shell/main.go b/go/cmd/gitlab-shell/main.go deleted file mode 100644 index adb5198..0000000 --- a/go/cmd/gitlab-shell/main.go +++ /dev/null @@ -1,44 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "gitlab.com/gitlab-org/gitlab-shell/go/internal/command" - "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/readwriter" - "gitlab.com/gitlab-org/gitlab-shell/go/internal/config" - "gitlab.com/gitlab-org/gitlab-shell/go/internal/executable" -) - -func main() { - readWriter := &readwriter.ReadWriter{ - Out: os.Stdout, - In: os.Stdin, - ErrOut: os.Stderr, - } - - executable, err := executable.New(executable.GitlabShell) - if err != nil { - fmt.Fprintln(readWriter.ErrOut, "Failed to determine executable, exiting") - os.Exit(1) - } - - config, err := config.NewFromDir(executable.RootDir) - if err != nil { - fmt.Fprintln(readWriter.ErrOut, "Failed to read config, exiting") - os.Exit(1) - } - - cmd, err := command.New(executable, os.Args[1:], config, readWriter) - if err != nil { - // For now this could happen if `SSH_CONNECTION` is not set on - // the environment - fmt.Fprintf(readWriter.ErrOut, "%v\n", err) - os.Exit(1) - } - - if err = cmd.Execute(); err != nil { - fmt.Fprintf(readWriter.ErrOut, "%v\n", err) - os.Exit(1) - } -} |