diff options
author | Nick Thomas <nick@gitlab.com> | 2019-06-04 15:28:47 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-06-04 15:28:47 +0100 |
commit | 220bb45d747504dcd34089005591b7c7d99c8940 (patch) | |
tree | 314b0b8fbac89bc251135a67bcf6926cc4cf68a0 | |
parent | 5ee3270e07b0f7cca8c2352816ea86a3b640a772 (diff) | |
download | gitlab-shell-220bb45d747504dcd34089005591b7c7d99c8940.tar.gz |
Respect GITLAB_SHELL_DIR in the Go version
-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 |