fix: decouple project root resolution from custom BH_CONFIG_PATH env

This commit is contained in:
duorameng
2026-05-18 17:26:30 +08:00
parent e8feeb0fcd
commit 28346bf6b4
2 changed files with 3 additions and 24 deletions
+1 -16
View File
@@ -93,22 +93,7 @@ func ResolveAbsScriptsDir() string {
return filepath.Clean(scriptsDir)
}
if configPath := os.Getenv("BH_CONFIG_PATH"); configPath != "" {
if !filepath.IsAbs(configPath) {
if absConfigPath, err := filepath.Abs(configPath); err == nil {
configPath = absConfigPath
}
}
projectRoot := filepath.Dir(filepath.Dir(configPath))
return filepath.Clean(filepath.Join(projectRoot, constant.ScriptsWorkDir))
}
if absScriptsDir, err := filepath.Abs(constant.ScriptsWorkDir); err == nil {
return absScriptsDir
}
return filepath.Clean(constant.ScriptsWorkDir)
return constant.ScriptsWorkDir
}
func appendEnvIfSet(envs *[]string, key, value string) {