feat: support abra testing mode
This commit is contained in:
parent
d9b4f4ef3b
commit
03b4e4b4e2
@ -14,7 +14,17 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var ABRA_DIR = os.ExpandEnv("$HOME/.abra")
|
||||
// getBaseDir retrieves the Abra base directory.
|
||||
func getBaseDir() string {
|
||||
home := os.ExpandEnv("$HOME/.abra")
|
||||
if _, exists := os.LookupEnv("ABRA_TEST"); exists {
|
||||
home = os.ExpandEnv("$HOME/.abra_test")
|
||||
logrus.Debugf("running under test mode as requested (ABRA_TEST)")
|
||||
}
|
||||
return home
|
||||
}
|
||||
|
||||
var ABRA_DIR = getBaseDir()
|
||||
var SERVERS_DIR = path.Join(ABRA_DIR, "servers")
|
||||
var RECIPES_DIR = path.Join(ABRA_DIR, "recipes")
|
||||
var VENDOR_DIR = path.Join(ABRA_DIR, "vendor")
|
||||
|
Loading…
x
Reference in New Issue
Block a user