Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved messaging when installing dfu #513

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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";
}
}
Loading