fix: replace all get current path method from "./" to os args
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user