From 09a6b8f6c0aa75275307cbb902da83417c0149f8 Mon Sep 17 00:00:00 2001 From: Pablo Ovelleiro Corral Date: Mon, 30 Aug 2021 15:35:08 +0200 Subject: [PATCH] feature (nixos): working directory override - #403 --- server/common/files.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/common/files.go b/server/common/files.go index 493a1bc6..d51cef50 100644 --- a/server/common/files.go +++ b/server/common/files.go @@ -12,6 +12,9 @@ func GetCurrentDir() string { if MOCK_CURRENT_DIR != "" { return MOCK_CURRENT_DIR } + if os.Getenv("WORK_DIR") != "" { + return os.Getenv("WORK_DIR") + } ex, _ := os.Executable() return filepath.Dir(ex) }