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

Fix -f flag when downloading OS and always write version.txt when not explicitly setting a version #465

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using CliFx.Attributes;
using Meadow.Cloud.Client;
using Meadow.Cloud.Client.Identity;
using Meadow.Software;
using Microsoft.Extensions.Logging;
using System.Diagnostics;
using System.Net.Http.Headers;

namespace Meadow.CLI.Commands.DeviceManagement;

Expand All @@ -15,7 +12,7 @@ public class FirmwareDownloadCommand : BaseFileCommand<FirmwareDownloadCommand>

public FirmwareDownloadCommand(
FileManager fileManager,
IMeadowCloudClient meadowCloudClient,
IMeadowCloudClient meadowCloudClient,
ISettingsManager settingsManager,
ILoggerFactory loggerFactory)
: base(fileManager, settingsManager, loggerFactory)
Expand Down Expand Up @@ -77,9 +74,14 @@ protected override async ValueTask ExecuteCommand()
return;
}

if (collection[Version] != null)
if (collection[Version] != null && Force == false)
stevenkuhn marked this conversation as resolved.
Show resolved Hide resolved
{
Logger?.LogInformation($"Firmware package '{Version}' already exists locally");

if (explicitVersion == false)
{
await collection.SetDefaultPackage(Version);
}
return;
}

Expand Down
1 change: 0 additions & 1 deletion Source/v2/Meadow.Cli/Commands/Legacy/DownloadOsCommand.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using CliFx.Attributes;
using Meadow.Cloud.Client;
using Meadow.Cloud.Client.Identity;
using Meadow.Software;
using Microsoft.Extensions.Logging;

Expand Down
Loading