fix self update path (#190)

This commit is contained in:
2022-04-27 00:43:47 +02:00
committed by GitHub
parent e43ab2dfd6
commit 985829800f
5 changed files with 12 additions and 10 deletions

View File

@@ -12,15 +12,13 @@ import (
"github.com/fatih/color"
)
var RESTIC_BIN string
func CheckIfCommandIsCallable(cmd string) bool {
_, err := exec.LookPath(cmd)
return err == nil
}
func CheckIfResticIsCallable() bool {
return CheckIfCommandIsCallable(RESTIC_BIN)
return CheckIfCommandIsCallable(flags.RESTIC_BIN)
}
type ExecuteOptions struct {
@@ -79,7 +77,7 @@ func ExecuteCommand(options ExecuteOptions, args ...string) (int, string, error)
}
func ExecuteResticCommand(options ExecuteOptions, args ...string) (int, string, error) {
options.Command = RESTIC_BIN
options.Command = flags.RESTIC_BIN
var c = GetConfig()
var optionsAsString = getOptions(c.Global, []string{"all"})
args = append(optionsAsString, args...)