Add check for restic before running
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
Fixes #2
This commit is contained in:
parent
3103fbde29
commit
0f78f237f0
5
main.go
5
main.go
@ -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")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user