diff --git a/Source/v2/Meadow.Cli/Commands/Current/Cloud/Package/CloudPackageCreateCommand.cs b/Source/v2/Meadow.Cli/Commands/Current/Cloud/Package/CloudPackageCreateCommand.cs index 192744d8..372777c4 100644 --- a/Source/v2/Meadow.Cli/Commands/Current/Cloud/Package/CloudPackageCreateCommand.cs +++ b/Source/v2/Meadow.Cli/Commands/Current/Cloud/Package/CloudPackageCreateCommand.cs @@ -13,7 +13,7 @@ public class CloudPackageCreateCommand : BaseCloudCommand c.LastWriteTime).First(); // trim - Logger?.LogInformation($"Trimming application..."); + var file = candidates.OrderByDescending(c => c.LastWriteTime).First(); + // trim + Logger?.LogInformation(string.Format(Strings.TrimmingApplicationForSpecifiedVersion, osVersion)); await _packageManager.TrimApplication(file, cancellationToken: CancellationToken); // package @@ -76,16 +80,16 @@ protected override async ValueTask ExecuteCommand() //TODO - properly manage shared paths var postlinkDir = Path.Combine(file.Directory?.FullName ?? string.Empty, PackageManager.PostLinkDirectoryName); - Logger?.LogInformation($"Assembling the MPAK..."); + Logger?.LogInformation(Strings.AssemblingCloudPackage); var packagePath = await _packageManager.AssemblePackage(postlinkDir, packageDir, osVersion, MpakName, Filter, true, CancellationToken); if (packagePath != null) { - Logger?.LogInformation($"Done. Package is available at {packagePath}"); + Logger?.LogInformation(string.Format(Strings.PackageAvailableAtSpecifiedPath, packagePath)); } else { - throw new CommandException($"Package assembly failed"); + throw new CommandException(Strings.PackageAssemblyFailed); } } } \ No newline at end of file diff --git a/Source/v2/Meadow.Cli/Strings.cs b/Source/v2/Meadow.Cli/Strings.cs index 224fa612..447201f7 100644 --- a/Source/v2/Meadow.Cli/Strings.cs +++ b/Source/v2/Meadow.Cli/Strings.cs @@ -18,4 +18,10 @@ public static class Strings public const string ProvisioningWithCloud = "Provisioning device with Meadow.Cloud..."; public const string ProvisioningSucceeded = "Device provisioned successfully"; public const string ProvisioningFailed = "Failed to provision device: {0}"; + public const string BuildingSpecifiedConfiguration = "Building {0} configuration of application..."; + public const string BuildFailed = "Build failed"; + public const string TrimmingApplicationForSpecifiedVersion = "Trimming application for OS version {0}..."; + public const string AssemblingCloudPackage = "Assembling the MPAK..."; + public const string PackageAssemblyFailed = "Package assembly failed"; + public const string PackageAvailableAtSpecifiedPath = "Done. Package is available at {0}"; }