diff options
| author | Fuwn <[email protected]> | 2025-11-24 21:22:01 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-11-24 21:22:01 -0800 |
| commit | 567ba5e85e0b267e975eba0dc2a1b482e1968d94 (patch) | |
| tree | 6244f0e0f3732cf65fa50785f3f2561525f733fa | |
| parent | 5616437de2e9b7db46233ee22e79717dda94d4ba (diff) | |
| download | yae-567ba5e85e0b267e975eba0dc2a1b482e1968d94.tar.xz yae-567ba5e85e0b267e975eba0dc2a1b482e1968d94.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...) |