Check whether rpm is installed (fanal#39)

* Check whether rpm is installed

* Apply the review
This commit is contained in:
Teppei Fukuda
2019-09-25 17:02:27 +03:00
committed by GitHub
parent cdeb41a58c
commit 3841cf6d94
3 changed files with 17 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package utils
import (
"fmt"
"os"
"os/exec"
"path/filepath"
)
@@ -29,3 +30,10 @@ func StringInSlice(a string, list []string) bool {
}
return false
}
func IsCommandAvailable(name string) bool {
if _, err := exec.LookPath(name); err != nil {
return false
}
return true
}