fix(): fix error message

This commit is contained in:
Nicolas Carlier 2020-01-28 20:10:45 +00:00
parent af3ba7edb0
commit 84524e9175

View File

@ -12,7 +12,7 @@ import (
func ResolveScript(dir, name string) (string, error) { func ResolveScript(dir, name string) (string, error) {
script := path.Clean(path.Join(dir, fmt.Sprintf("%s.sh", name))) script := path.Clean(path.Join(dir, fmt.Sprintf("%s.sh", name)))
if !strings.HasPrefix(script, dir) { if !strings.HasPrefix(script, dir) {
return "", errors.New("Invalid script path: " + script) return "", errors.New("Invalid script path: " + name)
} }
if _, err := os.Stat(script); os.IsNotExist(err) { if _, err := os.Stat(script); os.IsNotExist(err) {
return "", errors.New("Script not found: " + script) return "", errors.New("Script not found: " + script)