From 0f78f237f0a709566d02cb27cfbf9e8663a9ffb7 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Fri, 4 Nov 2022 14:37:32 -0700 Subject: [PATCH] Add check for restic before running Fixes #2 --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 01b1e9f..dffd0b2 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "fmt" "log" "os" + "os/exec" "strings" "github.com/hashicorp/hcl/v2" @@ -169,6 +170,10 @@ func main() { 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 { log.Fatalf("Requires a path to a job file, but found none") }