Skip to content

Commit

Permalink
Merge pull request #513 from WildernessLabs/dfu-install-cleanup
Browse files Browse the repository at this point in the history
Improved messaging when installing dfu
  • Loading branch information
jorgedevs authored Mar 6, 2024
2 parents d1b89af + 7c300a3 commit e26f0ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions Source/v2/Meadow.Cli/Commands/Current/Dfu/DfuInstallCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Meadow.CLI.Commands.DeviceManagement;

[Command("dfu install", Description = "Deploys a built Meadow application to a target device")]
[Command("dfu install", Description = "Install dfu-util to the host operating system")]
public class DfuInstallCommand : BaseSettingsCommand<AppDeployCommand>
{
public const string DefaultVersion = "0.11";
Expand Down Expand Up @@ -44,11 +44,19 @@ protected override async ValueTask ExecuteCommand()
{
if (IsAdministrator())
{
await DfuUtils.InstallDfuUtil(FileManager.WildernessTempFolderPath, Version, CancellationToken);
try
{
await DfuUtils.InstallDfuUtil(FileManager.WildernessTempFolderPath, Version, CancellationToken);
}
catch (Exception ex)
{
throw new CommandException($"Failed to install DFU {Version}: " + ex.Message);
}
Logger?.LogInformation($"DFU {Version} installed successfully");
}
else
{
Logger?.LogError("To install DFU on Windows, you'll need to re-run the command from as an Administrator");
Logger?.LogError("To install DFU on Windows, you'll need to run the command as an Administrator");
}
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
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.19.0</PackageVersion>
<PackageVersion>2.0.20.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,6 +6,6 @@ namespace Meadow.CLI
{
public static class Constants
{
public const string CLI_VERSION = "2.0.19.0";
public const string CLI_VERSION = "2.0.20.0";
}
}

0 comments on commit e26f0ec

Please sign in to comment.