fix: overridable ABRA_DIR
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-09-05 11:57:02 +02:00
committed by decentral1se
parent 25258d3d64
commit 58e78e4d7c
3 changed files with 26 additions and 16 deletions

View File

@ -17,9 +17,8 @@ import (
// 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)")
if customAbraDir, exists := os.LookupEnv("ABRA_DIR"); exists && customAbraDir != "" {
home = customAbraDir
}
return home
}