mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2025-09-06 18:40:40 +00:00
1.7.0 (#188)
* stream the output (#186) * dont duplicate global flags (#187) * docs for tagging * fix self update path (#190) * version bump & changelog
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/cupcakearmy/autorestic/internal/colors"
|
||||
"github.com/cupcakearmy/autorestic/internal/flags"
|
||||
)
|
||||
|
||||
type BackendRest struct {
|
||||
@@ -120,18 +119,15 @@ func (b Backend) validate() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
options := ExecuteOptions{Envs: env}
|
||||
options := ExecuteOptions{Envs: env, Silent: true}
|
||||
// Check if already initialized
|
||||
_, _, err = ExecuteResticCommand(options, "snapshots")
|
||||
_, _, err = ExecuteResticCommand(options, "check")
|
||||
if err == nil {
|
||||
return nil
|
||||
} else {
|
||||
// If not initialize
|
||||
colors.Body.Printf("Initializing backend \"%s\"...\n", b.name)
|
||||
_, out, err := ExecuteResticCommand(options, "init")
|
||||
if flags.VERBOSE {
|
||||
colors.Faint.Println(out)
|
||||
}
|
||||
_, _, err := ExecuteResticCommand(options, "init")
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -147,9 +143,6 @@ func (b Backend) Exec(args []string) error {
|
||||
colors.Error.Println(out)
|
||||
return err
|
||||
}
|
||||
if flags.VERBOSE {
|
||||
colors.Faint.Println(out)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user