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).
15 lines
279 B
Go
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)
|
|
}
|