Skip to content

Commit 4a148bc

Browse files
authored
Improve output with progress messages (#223)
***NO_CI***
1 parent 43af666 commit 4a148bc

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

nanoFirmwareFlasher.Library/EspTool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public EspTool(
116116
}
117117
catch (Exception ex)
118118
{
119-
if (Verbosity >= VerbosityLevel.Detailed)
119+
if (Verbosity >= VerbosityLevel.Normal)
120120
{
121121
Console.ForegroundColor = ConsoleColor.DarkRed;
122122

nanoFirmwareFlasher.Library/FirmwarePackage.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public static List<CloudSmithPackageDetail> GetTargetList(
177177
// check for empty array
178178
if (responseBody == "[]")
179179
{
180-
if (verbosity >= VerbosityLevel.Normal)
180+
if (verbosity > VerbosityLevel.Quiet)
181181
{
182182
Console.WriteLine("");
183183
}
@@ -378,7 +378,7 @@ internal async Task<ExitCodes> DownloadAndExtractAsync()
378378
// set property
379379
Version = match[0].Value;
380380

381-
if (Verbosity >= VerbosityLevel.Normal)
381+
if (Verbosity > VerbosityLevel.Detailed)
382382
{
383383
Console.ForegroundColor = ConsoleColor.Yellow;
384384
Console.WriteLine("Using cached firmware package");
@@ -389,7 +389,7 @@ internal async Task<ExitCodes> DownloadAndExtractAsync()
389389
{
390390
// no fw file available
391391

392-
if (Verbosity >= VerbosityLevel.Normal)
392+
if (Verbosity > VerbosityLevel.Quiet)
393393
{
394394
Console.ForegroundColor = ConsoleColor.Red;
395395
Console.WriteLine("Failure to download package and couldn't find one in the cache.");
@@ -403,7 +403,7 @@ internal async Task<ExitCodes> DownloadAndExtractAsync()
403403
// got here, must have a file!
404404

405405
// unzip the firmware
406-
if (Verbosity >= VerbosityLevel.Detailed)
406+
if (Verbosity >= VerbosityLevel.Normal)
407407
{
408408
Console.ForegroundColor = ConsoleColor.White;
409409
Console.Write($"Extracting {Path.GetFileName(fwFileName)}...");
@@ -413,7 +413,7 @@ internal async Task<ExitCodes> DownloadAndExtractAsync()
413413
Path.Combine(LocationPath, fwFileName),
414414
LocationPath);
415415

416-
if (Verbosity >= VerbosityLevel.Detailed)
416+
if (Verbosity >= VerbosityLevel.Normal)
417417
{
418418
Console.ForegroundColor = ConsoleColor.Green;
419419
Console.WriteLine("OK");
@@ -460,7 +460,7 @@ private static async Task<DownloadUrlResult> GetDownloadUrlAsync(
460460

461461
try
462462
{
463-
if (verbosity >= VerbosityLevel.Normal)
463+
if (verbosity >= VerbosityLevel.Detailed)
464464
{
465465
Console.ForegroundColor = ConsoleColor.White;
466466
Console.Write($"Trying to find {targetName} in {(isPreview ? "development" : "stable")} repository...");
@@ -478,7 +478,7 @@ private static async Task<DownloadUrlResult> GetDownloadUrlAsync(
478478
// check for empty array
479479
if (responseBody == "[]")
480480
{
481-
if (verbosity >= VerbosityLevel.Normal)
481+
if (verbosity >= VerbosityLevel.Detailed)
482482
{
483483
Console.ForegroundColor = ConsoleColor.Yellow;
484484
Console.WriteLine("Not found");
@@ -488,7 +488,7 @@ private static async Task<DownloadUrlResult> GetDownloadUrlAsync(
488488
// try now with community targets
489489
repoName = _communityTargetsRepo;
490490

491-
if (verbosity >= VerbosityLevel.Normal)
491+
if (verbosity >= VerbosityLevel.Detailed)
492492
{
493493
Console.ForegroundColor = ConsoleColor.White;
494494
Console.Write($"Trying to find {targetName} in community targets repository...");
@@ -513,7 +513,7 @@ private static async Task<DownloadUrlResult> GetDownloadUrlAsync(
513513
{
514514
Console.WriteLine("");
515515

516-
if (verbosity >= VerbosityLevel.Normal)
516+
if (verbosity > VerbosityLevel.Quiet)
517517
{
518518
Console.ForegroundColor = ConsoleColor.Red;
519519

@@ -553,7 +553,7 @@ private static async Task<DownloadUrlResult> GetDownloadUrlAsync(
553553

554554
Console.WriteLine("");
555555

556-
if (verbosity >= VerbosityLevel.Normal)
556+
if (verbosity > VerbosityLevel.Quiet)
557557
{
558558
Console.ForegroundColor = ConsoleColor.Red;
559559

@@ -581,7 +581,7 @@ private static async Task<DownloadUrlResult> GetDownloadUrlAsync(
581581

582582
Console.WriteLine("");
583583

584-
if (verbosity >= VerbosityLevel.Normal)
584+
if (verbosity > VerbosityLevel.Quiet)
585585
{
586586
// output helpful message
587587
Console.ForegroundColor = ConsoleColor.Red;
@@ -599,7 +599,7 @@ private static async Task<DownloadUrlResult> GetDownloadUrlAsync(
599599
return new DownloadUrlResult(string.Empty, string.Empty, ExitCodes.E9005);
600600
}
601601

602-
if (verbosity >= VerbosityLevel.Normal)
602+
if (verbosity > VerbosityLevel.Quiet)
603603
{
604604
Console.ForegroundColor = ConsoleColor.Green;
605605
Console.WriteLine($"OK");

0 commit comments

Comments
 (0)