diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2019-06-04 23:52:59 +0000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2019-06-04 23:52:59 +0000 |
commit | f61185b8a8f8974225a701137ba4b75cf5d4c4ef (patch) | |
tree | 314b0b8fbac89bc251135a67bcf6926cc4cf68a0 | |
parent | 5ee3270e07b0f7cca8c2352816ea86a3b640a772 (diff) | |
parent | 220bb45d747504dcd34089005591b7c7d99c8940 (diff) | |
download | gitlab-shell-f61185b8a8f8974225a701137ba4b75cf5d4c4ef.tar.gz |
Merge branch '187-respect-gitlab-shell-dir-envvar-in-go' into 'master'
Respect GITLAB_SHELL_DIR in the Go version
Closes #187
See merge request gitlab-org/gitlab-shell!309
-rw-r--r-- | go/cmd/gitlab-shell/main.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/go/cmd/gitlab-shell/main.go b/go/cmd/gitlab-shell/main.go index a8aef75..f4d519f 100644 --- a/go/cmd/gitlab-shell/main.go +++ b/go/cmd/gitlab-shell/main.go @@ -14,6 +14,10 @@ import ( // findRootDir determines the root directory (and so, the location of the config // file) from os.Executable() func findRootDir() (string, error) { + if path := os.Getenv("GITLAB_SHELL_DIR"); path != "" { + return path, nil + } + path, err := os.Executable() if err != nil { return "", err |