feat(ocis): add fail flag to conistency command

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2024-06-24 10:32:06 +02:00
parent 4f1f90d932
commit aa9ea12450
3 changed files with 15 additions and 4 deletions
+5 -1
View File
@@ -50,6 +50,10 @@ func ConsistencyCommand(cfg *config.Config) *cli.Command {
Usage: "the blobstore type. Can be (none, ocis, s3ng). Default ocis",
Value: "ocis",
},
&cli.BoolFlag{
Name: "fail",
Usage: "exit with non-zero status if consistency check fails",
},
},
Action: func(c *cli.Context) error {
basePath := c.String("basepath")
@@ -83,7 +87,7 @@ func ConsistencyCommand(cfg *config.Config) *cli.Command {
fmt.Println(err)
return err
}
if err := backup.CheckProviderConsistency(basePath, bs); err != nil {
if err := backup.CheckProviderConsistency(basePath, bs, c.Bool("fail")); err != nil {
fmt.Println(err)
return err
}