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

Add ability to specify path to OS binary when flashing + version bump… #577

Merged
merged 1 commit into from
Jun 11, 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
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,22 @@ protected override async ValueTask ExecuteCommand()

if (FirmwareFileTypes.Contains(FirmwareType.OS))
{
var osFileWithBootloader = package.GetFullyQualifiedPath(package.OSWithBootloader);
var osFileWithoutBootloader = package.GetFullyQualifiedPath(package.OsWithoutBootloader);
string? osFileWithBootloader = null;
string? osFileWithoutBootloader = null;

if (osFileWithBootloader == null && osFileWithoutBootloader == null)
if (string.IsNullOrWhiteSpace(IndividualFile))
{
throw new CommandException(string.Format(Strings.OsFileNotFoundForSpecifiedVersion, package.Version));
osFileWithBootloader = package.GetFullyQualifiedPath(package.OSWithBootloader);
osFileWithoutBootloader = package.GetFullyQualifiedPath(package.OsWithoutBootloader);

if (osFileWithBootloader == null && osFileWithoutBootloader == null)
{
throw new CommandException(string.Format(Strings.OsFileNotFoundForSpecifiedVersion, package.Version));
}
}
else
{
osFileWithBootloader = IndividualFile;
}

// do we have a dfu device attached, or is DFU specified?
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.47.0</PackageVersion>
<PackageVersion>2.0.48.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.47.0";
public const string CLI_VERSION = "2.0.48.0";
}
8 changes: 8 additions & 0 deletions Source/v2/Meadow.Cli/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@
"commandName": "Project",
"commandLineArgs": "firmware write runtime"
},
"Firmware Write runtime local file": {
"commandName": "Project",
"commandLineArgs": "firmware write runtime -f g:\\Meadow.OS.Runtime.bin"
},
"Firmware Write esp": {
"commandName": "Project",
"commandLineArgs": "firmware write esp"
Expand All @@ -171,6 +175,10 @@
"commandName": "Project",
"commandLineArgs": "firmware write os -v 1.2.0.1"
},
"Firmware Write OS local file": {
"commandName": "Project",
"commandLineArgs": "firmware write OS -f g:\\Meadow.OS.bin"
},
"Flash erase": {
"commandName": "Project",
"commandLineArgs": "flash erase"
Expand Down
6 changes: 3 additions & 3 deletions Source/v2/Meadow.Tooling.Core/App/AppManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static async Task DeployApplication(
// delete those files
foreach (var file in removeFiles)
{
logger?.LogInformation($"Deleting file '{file}'...");
logger?.LogInformation($"Deleting '{file}'");
var folder = string.IsNullOrEmpty(file.Path) ? $"/{MeadowRootFolder}/" : $"{file.Path}";

await connection.DeleteFile($"{folder}{file.Name}", cancellationToken);
Expand Down Expand Up @@ -163,12 +163,12 @@ public static async Task DeployApplication(

if (crc == localFile.Value)
{ // exists and has a matching CRC, skip it
logger?.LogInformation($"Skipping '{localFile.Key}'");
logger?.LogInformation($"Skipping '{Path.GetFileName(localFile.Key)}'");
continue;
}
}

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

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