From 0a6b0d44c074989230147d372e442b5aafb4ba82 Mon Sep 17 00:00:00 2001 From: Alexander Winnen Date: Sun, 2 Jun 2019 19:54:46 +0200 Subject: [PATCH] add option to remove backup from app after it has been downloaded --- cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs index 4bad0ea3..e10762b0 100644 --- a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs +++ b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs @@ -75,6 +75,12 @@ public async Task Create(CreateArguments arguments) } Console.WriteLine("Backup completed. Download completed"); + + if (arguments.DeleteAfterDownload) + { + Console.WriteLine("Removing backup from app..."); + await backupsClient.DeleteBackupAsync(app, foundBackup.Id.ToString()); + } } else { @@ -88,6 +94,9 @@ public sealed class CreateArguments : IArgumentModel [Option(LongName = "timeout", Description = "The timeout to wait for the backup in minutes.")] public int Timeout { get; set; } = 30; + [Option(LongName = "deleteAfterDownload", Description = "Defines wether the created backup shall be deleted from app after the backup task is completed")] + public bool DeleteAfterDownload { get; set; } + [Argument(Name = "file", Description = "The target file.")] public string File { get; set; }