Skip to content

Commit

Permalink
Merge pull request #579 from WildernessLabs/output_cleanup
Browse files Browse the repository at this point in the history
Output cleanup
  • Loading branch information
adrianstevens authored Jun 16, 2024
2 parents aaac4f6 + c5d0622 commit 5bd23cc
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void OnFileWriteProgress(object? sender, (string fileName, long complete
if (!double.IsNaN(p))
{
// Console instead of Logger due to line breaking for progress bar
Console?.Output.Write($"Writing {e.fileName}: {p:0}% \r");
Console?.Output.Write($"Writing '{e.fileName}': {p:0}% \r");
}
}
}
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Cli/Commands/Current/App/AppRunCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private void OnFileWriteProgress(object? sender, (string fileName, long complete

if (!double.IsNaN(p))
{ // Console instead of Logger due to line breaking for progress bar
Console?.Output.Write($"Writing {e.fileName}: {p:0}% \r");
Console?.Output.Write($"Writing '{e.fileName}': {p:0}% \r");
}
}

Expand Down
11 changes: 9 additions & 2 deletions Source/v2/Meadow.Cli/Commands/Current/File/FileDeleteCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ protected override async ValueTask ExecuteCommand()
await device.RuntimeDisable(CancellationToken);
}

Logger?.LogInformation($"Looking for file {MeadowFile}...");
if (MeadowFile == "all")
{
Logger?.LogInformation($"Looking for files...");
}
else
{
Logger?.LogInformation($"Looking for file {MeadowFile}...");
}

var folder = AppTools.SanitizeMeadowFolderName(Path.GetDirectoryName(MeadowFile)!);

Expand Down Expand Up @@ -60,7 +67,7 @@ protected override async ValueTask ExecuteCommand()
}
else
{
Logger?.LogInformation($"Deleting file '{file}' from device...");
Logger?.LogInformation($"Deleting '{file}'");
await device.DeleteFile(file, CancellationToken);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected override async ValueTask ExecuteCommand()
if (!double.IsNaN(p))
{
// Console instead of Logger due to line breaking for progress bar
Console?.Output.Write($"Writing {e.fileName}: {p:0}% \r");
Console?.Output.Write($"Writing '{e.fileName}': {p:0}% \r");
}
};

Expand Down
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Cli/Meadow.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Authors>Wilderness Labs, Inc</Authors>
<Company>Wilderness Labs, Inc</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>2.0.48.0</PackageVersion>
<PackageVersion>2.0.49.0</PackageVersion>
<Platforms>AnyCPU</Platforms>
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.CLI/</PackageProjectUrl>
<RepositoryUrl>https://github.com/WildernessLabs/Meadow.CLI</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Cli/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ namespace Meadow.CLI;

public static class Constants
{
public const string CLI_VERSION = "2.0.48.0";
public const string CLI_VERSION = "2.0.49.0";
}
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Dfu/DfuUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static async Task<bool> FlashFile(string fileName, string? dfuSerialNumbe
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
logger.LogError("dfu-util not found - to install, run: `meadow install dfu-util` (may require administrator mode)");
logger.LogError("dfu-util not found - to install, run: `meadow dfu install` (may require administrator mode)");
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Expand Down
2 changes: 0 additions & 2 deletions Source/v2/Meadow.Hcom/Connections/SerialConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,8 +1036,6 @@ void OnFileRetry(object? sender, EventArgs e)
FileException += OnFileError;
FileWriteFailed += OnFileRetry;

Debug.WriteLine($"Sending '{localFileName}'");

EnqueueRequest(command);

// this will wait for a "file write accepted" from the target
Expand Down
2 changes: 1 addition & 1 deletion Source/v2/Meadow.Tooling.Core/App/AppManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public static async Task DeployApplication(
}
}

logger?.LogInformation($"Sending '{Path.GetFileName(localFile.Key)}'");
logger?.LogInformation($"Sending '{Path.GetFileName(localFile.Key)}'".PadRight(80));
send_file:

if (!await connection.WriteFile(localFile.Key, meadowFilename, cancellationToken))
Expand Down

0 comments on commit 5bd23cc

Please sign in to comment.