fix: undefined vars on windows

snail
sammyette 2024-12-29 01:48:11 -04:00
parent a8435b649d
commit 7174f40b5f
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 6 additions and 4 deletions

View File

@ -5,6 +5,8 @@ package util
import ( import (
"path/filepath" "path/filepath"
"os" "os"
"hilbish/util"
) )
func FindExecutable(path string, inPath, dirs bool) error { func FindExecutable(path string, inPath, dirs bool) error {
@ -21,15 +23,15 @@ func FindExecutable(path string, inPath, dirs bool) error {
} else { } else {
_, err := os.Stat(path) _, err := os.Stat(path)
if err == nil { if err == nil {
if contains(pathExts, nameExt) { return nil } if util.Contains(pathExts, nameExt) { return nil }
return errNotExec return util.ErrNotExec
} }
} }
} else { } else {
_, err := os.Stat(path) _, err := os.Stat(path)
if err == nil { if err == nil {
if contains(pathExts, nameExt) { return nil } if util.Contains(pathExts, nameExt) { return nil }
return errNotExec return util.ErrNotExec
} }
} }