diff --git a/opencloud/pkg/command/trash.go b/opencloud/pkg/command/trash.go index 0f28666bd1..5e3ca0b19c 100644 --- a/opencloud/pkg/command/trash.go +++ b/opencloud/pkg/command/trash.go @@ -41,7 +41,8 @@ func TrashPurgeEmptyDirsCommand(cfg *config.Config) *cobra.Command { return nil } - if err := trash.PurgeTrashEmptyPaths(basePath, cmd.Flag("dry-run").Changed); err != nil { + dryRun, _ := cmd.Flags().GetBool("dry-run") + if err := trash.PurgeTrashEmptyPaths(basePath, dryRun); err != nil { fmt.Println(err) return err }