This repository has been archived on 2022-09-20. You can view files and clone it, but cannot push or open issues or pull requests.
go-musicbot/util/util.go
2021-07-28 17:30:01 +02:00

16 lines
313 B
Go

package util
import (
"os/exec"
)
// Not using "command -v" because it doesn't work with Windows.
// testArg will usually be something like --version.
func CheckInstalled(program, testArg string) bool {
cmd := exec.Command(program, testArg)
if err := cmd.Run(); err != nil {
return false
}
return true
}