sbctl: Implement check for sbctl installation

Signed-off-by: Morten Linderud <morten@linderud.pw>
This commit is contained in:
Morten Linderud 2021-06-01 00:59:48 +02:00
parent d04e117cbc
commit 2d65668632
No known key found for this signature in database
GPG Key ID: E742683BA08CB2FF
1 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package sbctl
import (
"encoding/json"
"errors"
"fmt"
"io"
"log"
@ -199,3 +200,11 @@ func CreateBundle(bundle Bundle) error {
return nil
}
// Checks if sbctl is setup on this computer
func CheckSbctlInstallation(path string) bool {
if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) {
return false
}
return true
}