fix: repo sync error

This commit is contained in:
engigu
2026-03-19 16:08:02 +08:00
parent 9c5da93a27
commit 05104415ce
12 changed files with 675 additions and 229 deletions
+4
View File
@@ -3,6 +3,7 @@ package controllers
import (
"encoding/json"
"path/filepath"
"strings"
"github.com/engigu/baihu-panel/internal/constant"
"github.com/engigu/baihu-panel/internal/models"
@@ -39,6 +40,9 @@ func resolveWorkDir(workDir string) string {
return absPath
}
// 如果已经是绝对路径,直接返回
if strings.HasPrefix(workDir, "$SCRIPTS_DIR$") {
return workDir
}
if filepath.IsAbs(workDir) {
return workDir
}