wisski-cloud-distillery/pkg/execx/look.go
Tom Wiesing a360324f62
Refactor Package structure
This commit cleans up the package structure, to make two new top-level
packages `internal` (for internal-use packages) and `pkg` (for general
shared utility code).
2022-09-12 15:42:21 +02:00

15 lines
279 B
Go

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)
}