diff --git a/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndExportMigrations_DoNotWriteToConsoleAndDoDownload.verified.txt b/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndExportMigrations_DoNotWriteToConsoleAndDoDownload.verified.txt index c1b8d74..db14a4e 100644 --- a/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndExportMigrations_DoNotWriteToConsoleAndDoDownload.verified.txt +++ b/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndExportMigrations_DoNotWriteToConsoleAndDoDownload.verified.txt @@ -1 +1,2 @@ -emptyString \ No newline at end of file +test1 +test2 diff --git a/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndLatest_DoNotWriteToConsoleAndDownloadLatest.verified.txt b/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndLatest_DoNotWriteToConsoleAndDownloadLatest.verified.txt index c1b8d74..a13c399 100644 --- a/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndLatest_DoNotWriteToConsoleAndDownloadLatest.verified.txt +++ b/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndLatest_DoNotWriteToConsoleAndDownloadLatest.verified.txt @@ -1 +1 @@ -emptyString \ No newline at end of file +test diff --git a/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndNoMigrations_DoNotWriteToConsoleAndDownloadLatest.verified.txt b/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndNoMigrations_DoNotWriteToConsoleAndDownloadLatest.verified.txt index c1b8d74..a13c399 100644 --- a/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndNoMigrations_DoNotWriteToConsoleAndDownloadLatest.verified.txt +++ b/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Download/DownloadRunnerTests.RunAsync_QuietAndNoMigrations_DoNotWriteToConsoleAndDownloadLatest.verified.txt @@ -1 +1 @@ -emptyString \ No newline at end of file +test diff --git a/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Migrate/MigrateRunnerTests.RunAsync_Quiet_DoNotWriteToConsoleAndMigrate.verified.txt b/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Migrate/MigrateRunnerTests.RunAsync_Quiet_DoNotWriteToConsoleAndMigrate.verified.txt index c1b8d74..7bcb5fb 100644 --- a/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Migrate/MigrateRunnerTests.RunAsync_Quiet_DoNotWriteToConsoleAndMigrate.verified.txt +++ b/GithubBackup/GithubBackup.Cli.Tests/Commands/Github/Migrate/MigrateRunnerTests.RunAsync_Quiet_DoNotWriteToConsoleAndMigrate.verified.txt @@ -1 +1 @@ -emptyString \ No newline at end of file +1 diff --git a/GithubBackup/GithubBackup.Cli/Commands/Github/Backup/BackupRunner.cs b/GithubBackup/GithubBackup.Cli/Commands/Github/Backup/BackupRunner.cs index 678e156..c4dceba 100644 --- a/GithubBackup/GithubBackup.Cli/Commands/Github/Backup/BackupRunner.cs +++ b/GithubBackup/GithubBackup.Cli/Commands/Github/Backup/BackupRunner.cs @@ -76,13 +76,6 @@ await _loginService.WithPersistentAsync( ct ); - if (!_globalArgs.Quiet) - { - _ansiConsole.WriteLine(!_globalArgs.Quiet ? $"Downloaded migration {migration.Id} ({file})" : file); - } - else - { - _ansiConsole.WriteLine(file); - } + _ansiConsole.WriteLine(!_globalArgs.Quiet ? $"Downloaded migration {migration.Id} ({file})" : file); } } \ No newline at end of file diff --git a/GithubBackup/GithubBackup.Cli/Commands/Github/Download/DownloadRunner.cs b/GithubBackup/GithubBackup.Cli/Commands/Github/Download/DownloadRunner.cs index 221aa97..0183c7d 100644 --- a/GithubBackup/GithubBackup.Cli/Commands/Github/Download/DownloadRunner.cs +++ b/GithubBackup/GithubBackup.Cli/Commands/Github/Download/DownloadRunner.cs @@ -117,18 +117,14 @@ private async Task DownloadMigrationUsingIdAsync(long id, CancellationToken ct) _ansiConsole.WriteLine($"Downloading migration {id} to {_downloadArgs.Destination}..."); var progress = _ansiConsole.Progress(); progress.RefreshRate = TimeSpan.FromSeconds(5); - await progress.StartAsync(async _ => - { - var path = await DownloadMigrationAsync(id, ct); - _ansiConsole.WriteLine($"Downloaded migration {id} to {path}"); - }); + await progress.StartAsync(_ => DownloadMigrationAsync(id, ct)); return; } await DownloadMigrationAsync(id, ct); } - private async Task DownloadMigrationAsync(long id, CancellationToken ct) + private async Task DownloadMigrationAsync(long id, CancellationToken ct) { var options = new DownloadMigrationOptions( id, @@ -139,6 +135,6 @@ private async Task DownloadMigrationAsync(long id, CancellationToken ct) var path = await _migrationService.DownloadMigrationAsync(options, ct); _logger.LogInformation("Downloaded migration {Id} to {Path}", id, path); - return path; + _ansiConsole.WriteLine(!_globalArgs.Quiet ? $"Downloaded migration {id} to {path}" : path); } } \ No newline at end of file diff --git a/GithubBackup/GithubBackup.Cli/Commands/Github/Migrate/MigrateRunner.cs b/GithubBackup/GithubBackup.Cli/Commands/Github/Migrate/MigrateRunner.cs index 77c13a8..ca16718 100644 --- a/GithubBackup/GithubBackup.Cli/Commands/Github/Migrate/MigrateRunner.cs +++ b/GithubBackup/GithubBackup.Cli/Commands/Github/Migrate/MigrateRunner.cs @@ -49,9 +49,6 @@ await _loginService.WithPersistentAsync( var migration = await _migrationService.StartMigrationAsync(options, ct); - if (!_globalArgs.Quiet) - { - _ansiConsole.WriteLine($"Migration started with id {migration.Id}"); - } + _ansiConsole.WriteLine(!_globalArgs.Quiet ? $"Migration started with id {migration.Id}" : $"{migration.Id}"); } } \ No newline at end of file