aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-11-25 05:22:01 +0000
committerFuwn <[email protected]>2025-11-25 05:22:01 +0000
commitcf21690f63bd62e3e92f65b0a7d5ec2b23d84fce (patch)
tree6244f0e0f3732cf65fa50785f3f2561525f733fa
parentrefactor(source): Unconditionally trim suffix (diff)
downloadyae-cf21690f63bd62e3e92f65b0a7d5ec2b23d84fce.tar.xz
yae-cf21690f63bd62e3e92f65b0a7d5ec2b23d84fce.zip
feat(utilities): Error check executable path
-rw-r--r--internal/yae/utilities.go7
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...)