|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
|
|
"github.com/cupcakearmy/autorestic/internal"
|
|
|
|
|
"github.com/cupcakearmy/autorestic/internal/colors"
|
|
|
|
|
"github.com/cupcakearmy/autorestic/internal/lock"
|
|
|
|
@ -18,10 +20,23 @@ var execCmd = &cobra.Command{
|
|
|
|
|
|
|
|
|
|
selected, err := internal.GetAllOrSelected(cmd, true)
|
|
|
|
|
CheckErr(err)
|
|
|
|
|
|
|
|
|
|
var errors []error
|
|
|
|
|
for _, name := range selected {
|
|
|
|
|
colors.PrimaryPrint(" Executing on \"%s\" ", name)
|
|
|
|
|
backend, _ := internal.GetBackend(name)
|
|
|
|
|
backend.Exec(args)
|
|
|
|
|
err := backend.Exec(args)
|
|
|
|
|
if err != nil {
|
|
|
|
|
errors = append(errors, err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if len(errors) > 0 {
|
|
|
|
|
for _, err := range errors {
|
|
|
|
|
colors.Error.Printf("%s\n\n", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CheckErr(fmt.Errorf("%d errors were found", len(errors)))
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|