add failure and success hooks

This commit is contained in:
2021-05-06 15:55:32 +02:00
parent aebaf0a225
commit e05386b0b5
4 changed files with 68 additions and 27 deletions

View File

@@ -17,15 +17,15 @@ var backupCmd = &cobra.Command{
CheckErr(err)
defer lock.Unlock()
CheckErr(internal.CheckConfig())
internal.GetConfig()
selected, err := internal.GetAllOrSelected(cmd, false)
CheckErr(err)
errors := 0
for _, name := range selected {
location, _ := internal.GetLocation(name)
err := location.Backup(false)
if err != nil {
errs := location.Backup(false)
for err := range errs {
colors.Error.Println(err)
errors++
}