preliminary version of enable complete

This commit is contained in:
Tai Groot
2021-05-14 16:44:39 -07:00
parent f9f44604e1
commit 2517125d98
3 changed files with 47 additions and 14 deletions

10
util.go
View File

@@ -4,6 +4,7 @@ import (
"bytes"
"context"
"os/exec"
"regexp"
)
var systemctl string
@@ -38,3 +39,12 @@ func execute(ctx context.Context, args []string) (string, string, int, error) {
return output, warnings, code, err
}
func filterErr(stderr string) error {
matched, _ := regexp.MatchString(`does not exist`, stderr)
if matched {
return ErrDoesNotExist
}
return nil
}