fix: replace all get current path method from "./" to os args
This commit is contained in:
+3
-3
@@ -94,7 +94,7 @@ func syncRunningInstancesToWatchdog() {
|
||||
|
||||
func ensureWatchdogProcess() error {
|
||||
watchdogName, err := getWatchdogBinaryName()
|
||||
exec.Command("chmod", "+x", filepath.Join(".", "watchdog", watchdogName)).Run()
|
||||
exec.Command("chmod", "+x", filepath.Join(global.CurrentPath, "watchdog", watchdogName)).Run()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -105,7 +105,7 @@ func ensureWatchdogProcess() error {
|
||||
}
|
||||
postLog.Info(fmt.Sprintf("Watchdog process %s is not running, starting it...", watchdogName))
|
||||
|
||||
watchdogPath := filepath.Join(".", "watchdog", watchdogName)
|
||||
watchdogPath := filepath.Join(global.CurrentPath, "watchdog", watchdogName)
|
||||
if !utils.IsFileExist(watchdogPath) {
|
||||
return fmt.Errorf("watchdog binary not found: %s", watchdogPath)
|
||||
}
|
||||
@@ -136,7 +136,7 @@ func getWatchdogBinaryName() (string, error) {
|
||||
case "init.d":
|
||||
return "watchdog_initd", nil
|
||||
case "windows":
|
||||
if utils.IsFileExist(filepath.Join(".", "watchdog", "watchdog_windows.exe")) {
|
||||
if utils.IsFileExist(filepath.Join(global.CurrentPath, "watchdog", "watchdog_windows.exe")) {
|
||||
return "watchdog_windows.exe", nil
|
||||
}
|
||||
return "watchdog_windows", nil
|
||||
|
||||
Reference in New Issue
Block a user