diff options
| author | Fuwn <[email protected]> | 2025-11-25 05:22:01 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-11-25 05:22:01 +0000 |
| commit | cf21690f63bd62e3e92f65b0a7d5ec2b23d84fce (patch) | |
| tree | 6244f0e0f3732cf65fa50785f3f2561525f733fa | |
| parent | refactor(source): Unconditionally trim suffix (diff) | |
| download | yae-cf21690f63bd62e3e92f65b0a7d5ec2b23d84fce.tar.xz yae-cf21690f63bd62e3e92f65b0a7d5ec2b23d84fce.zip | |
feat(utilities): Error check executable path
| -rw-r--r-- | internal/yae/utilities.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/yae/utilities.go b/internal/yae/utilities.go index 73042fd..f6fc32c 100644 --- a/internal/yae/utilities.go +++ b/internal/yae/utilities.go @@ -37,7 +37,12 @@ func FetchSRIHash(sha256 string) (string, error) { func command(name string, show bool, args ...string) (string, error) { executable, err := exec.LookPath(name) - out := []byte{} + + if err != nil { + return "", fmt.Errorf("command not found: %s", name) + } + + var out []byte if show { cmd := exec.Command(executable, args...) |