This commit is contained in:
r4
2021-07-28 17:30:01 +02:00
parent 6dfb9bc0b1
commit d2fae31d1a
12 changed files with 1501 additions and 0 deletions

15
util/util.go Normal file
View File

@@ -0,0 +1,15 @@
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
}