mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-10 03:47:03 +02:00
20 lines
328 B
Go
20 lines
328 B
Go
|
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)
|
||
|
}
|
||
|
}
|