fix: replace all get current path method from "./" to os args

This commit is contained in:
2026-05-11 14:03:00 +08:00
parent 5c748dafcd
commit ebc8ced8dd
4 changed files with 22 additions and 9 deletions
+13
View File
@@ -9,6 +9,7 @@ import (
"strconv"
"strings"
"time"
"path/filepath"
"super-frpc/database"
"super-frpc/global"
@@ -200,3 +201,15 @@ func RestartProcess() error {
os.Exit(0)
return nil
}
func GetCurrentPath() (string) {
filePath, _ := exec.LookPath(os.Args[0])
if filePath == "" {
return ""
}
absPath, err := filepath.Abs(filePath)
if err != nil {
return ""
}
return filepath.Dir(absPath)
}