1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/internal/testlib/path.go

20 lines
328 B
Go
Raw Normal View History

package testlib
import (
"os"
"os/exec"
"testing"
)
// CheckPath skips the test if the binary is not in the PATH.
func CheckPath(tb testing.TB, cmd string) {
tb.Helper()
if os.Getenv("CI") == "true" {
// never skip on CI
return
}
if _, err := exec.LookPath(cmd); err != nil {
tb.Skipf("%s not in PATH", cmd)
}
}