Add check for restic before running
Some checks failed
continuous-integration/drone/push Build is failing

Fixes #2
This commit is contained in:
IamTheFij 2022-11-04 14:37:32 -07:00
parent 3103fbde29
commit 0f78f237f0

View File

@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"log" "log"
"os" "os"
"os/exec"
"strings" "strings"
"github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2"
@ -169,6 +170,10 @@ func main() {
return return
} }
if _, err := exec.LookPath("restic"); err != nil {
log.Fatalf("Could not find restic in path. Make sure it's installed")
}
if flag.NArg() == 0 { if flag.NArg() == 0 {
log.Fatalf("Requires a path to a job file, but found none") log.Fatalf("Requires a path to a job file, but found none")
} }