fix: use exec.LookPath instead of 'command -v' for binary detection

'command' is a shell builtin, not a real binary, so exec.Command
always failed with exit 127. Replaced with os/exec.LookPath which
correctly resolves binaries in PATH.

Also adds capabilities_test.go to verify Probe() matches
exec.LookPath results.

Version: 0.7.2
This commit is contained in:
2026-07-07 00:06:06 -04:00
parent d3d59b4e45
commit e5b9b233b8
3 changed files with 57 additions and 7 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
BINARY=nasctl
VERSION?=0.7.1
VERSION?=0.7.2
GO?=go
LDFLAGS=-s -w -X github.com/darroyo/nasctl/internal/web.Version=$(VERSION) -X github.com/darroyo/nasctl/internal/web.Commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
BUILD_FLAGS=CGO_ENABLED=0