diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2019-06-05 10:17:03 +1000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2019-06-05 22:01:30 +1000 |
commit | 89d6b5eda73c3654a091ff1474c1f25b4aabb072 (patch) | |
tree | 9863dac86b2c6f224a0c3f93caaeeed0624d6fb3 | |
parent | b69260a16b04e2f0e169b5f8a186460c29fa449e (diff) | |
download | gitlab-shell-193-follow-up-from-respect-gitlab_shell_dir-in-the-go-version.tar.gz |
Add rootDir validation193-follow-up-from-respect-gitlab_shell_dir-in-the-go-version
-rw-r--r-- | go/cmd/gitlab-shell/main.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/go/cmd/gitlab-shell/main.go b/go/cmd/gitlab-shell/main.go index f4d519f..58bd464 100644 --- a/go/cmd/gitlab-shell/main.go +++ b/go/cmd/gitlab-shell/main.go @@ -52,6 +52,11 @@ func main() { os.Exit(1) } + if _, err := os.Stat(rootDir); os.IsNotExist(err) { + fmt.Fprintf(readWriter.ErrOut, "Root directory %q does not exist, exiting\n", rootDir) + 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) |