Skip to content

Commit

Permalink
fix output
Browse files Browse the repository at this point in the history
  • Loading branch information
byCrookie committed Oct 28, 2023
1 parent 4d4e311 commit b916339
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
emptyString
test1
test2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
emptyString
test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
emptyString
test
Original file line number Diff line number Diff line change
@@ -1 +1 @@
emptyString
1
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> DownloadMigrationAsync(long id, CancellationToken ct)
private async Task DownloadMigrationAsync(long id, CancellationToken ct)
{
var options = new DownloadMigrationOptions(
id,
Expand All @@ -139,6 +135,6 @@ private async Task<string> 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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}
}

0 comments on commit b916339

Please sign in to comment.