internal: Improve error message consistency

This commit is contained in:
Tom Wiesing 2022-09-04 14:01:01 +02:00
parent 5d906169f4
commit a64c02cd78
No known key found for this signature in database
7 changed files with 72 additions and 71 deletions

15
internal/execx/look.go Normal file
View file

@ -0,0 +1,15 @@
package execx
import (
"os/exec"
"path/filepath"
)
// LookPathAbs is like [exec.LookPath], but always returns an absolute path
func LookPathAbs(file string) (string, error) {
path, err := exec.LookPath(file)
if err != nil {
return "", err
}
return filepath.Abs(path)
}