summaryrefslogtreecommitdiff
path: root/go/cmd/gitlab-shell/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/cmd/gitlab-shell/main.go')
-rw-r--r--go/cmd/gitlab-shell/main.go18
1 files changed, 2 insertions, 16 deletions
diff --git a/go/cmd/gitlab-shell/main.go b/go/cmd/gitlab-shell/main.go
index f4d519f..be388d3 100644
--- a/go/cmd/gitlab-shell/main.go
+++ b/go/cmd/gitlab-shell/main.go
@@ -6,7 +6,6 @@ import (
"path/filepath"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command"
- "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/fallback"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/go/internal/config"
)
@@ -28,17 +27,6 @@ func findRootDir() (string, error) {
return filepath.Dir(filepath.Dir(path)), nil
}
-// rubyExec will never return. It either replaces the current process with a
-// Ruby interpreter, or outputs an error and kills the process.
-func execRuby(rootDir string, readWriter *readwriter.ReadWriter) {
- cmd := &fallback.Command{RootDir: rootDir, Args: os.Args}
-
- if err := cmd.Execute(); err != nil {
- fmt.Fprintf(readWriter.ErrOut, "Failed to exec: %v\n", err)
- os.Exit(1)
- }
-}
-
func main() {
readWriter := &readwriter.ReadWriter{
Out: os.Stdout,
@@ -52,12 +40,10 @@ func main() {
os.Exit(1)
}
- // Fall back to Ruby in case of problems reading the config, but issue a
- // warning as this isn't something we can sustain indefinitely
config, err := config.NewFromDir(rootDir)
if err != nil {
- fmt.Fprintln(readWriter.ErrOut, "Failed to read config, falling back to gitlab-shell-ruby")
- execRuby(rootDir, readWriter)
+ fmt.Fprintln(readWriter.ErrOut, "Failed to read config, exiting")
+ os.Exit(1)
}
cmd, err := command.New(os.Args, config, readWriter)