From d1edf7e13e01d2d28c4a5c33991499b4c5d831b5 Mon Sep 17 00:00:00 2001 From: Donkey Date: Wed, 18 Sep 2024 13:04:40 +0200 Subject: [PATCH] fix: update should get latest version if non is given --- TwinpackCli/Commands/AbstractCommand.cs | 8 ++++---- TwinpackCore/Core/TwinpackService.cs | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/TwinpackCli/Commands/AbstractCommand.cs b/TwinpackCli/Commands/AbstractCommand.cs index 3502567..4d7520d 100644 --- a/TwinpackCli/Commands/AbstractCommand.cs +++ b/TwinpackCli/Commands/AbstractCommand.cs @@ -66,10 +66,10 @@ protected List CreatePackageItems(string[] packages, string[] versi Config = new ConfigPlcPackage { Name = packages?.ElementAt(i), - Version = versions?.ElementAtOrDefault(i) ?? null, - Branch = branches?.ElementAtOrDefault(i) ?? null, - Target = targets?.ElementAtOrDefault(i) ?? null, - Configuration = configurations?.ElementAtOrDefault(i) ?? null + Version = versions?.ElementAtOrDefault(i), + Branch = branches?.ElementAtOrDefault(i), + Target = targets?.ElementAtOrDefault(i), + Configuration = configurations?.ElementAtOrDefault(i) } }); } diff --git a/TwinpackCore/Core/TwinpackService.cs b/TwinpackCore/Core/TwinpackService.cs index 980ab6e..fc7f4b0 100644 --- a/TwinpackCore/Core/TwinpackService.cs +++ b/TwinpackCore/Core/TwinpackService.cs @@ -399,19 +399,19 @@ public async System.Threading.Tasks.Task> UpdatePackagesAsync( var i = filters.Packages != null && package.Package.Name != null ? Array.IndexOf(filters.Packages, package.Package.Name) : -1; if (i >= 0) { - package.Config.Version = filters.Versions?.ElementAtOrDefault(i) ?? package.PackageVersion.Version; - package.Config.Branch = filters.Branches?.ElementAtOrDefault(i) ?? package.PackageVersion.Branch; - package.Config.Configuration = filters.Configurations?.ElementAtOrDefault(i) ?? package.PackageVersion.Configuration; - package.Config.Target = filters.Targets?.ElementAtOrDefault(i) ?? package.PackageVersion.Target; + package.Config.Version = filters.Versions?.ElementAtOrDefault(i); + package.Config.Branch = filters.Branches?.ElementAtOrDefault(i); + package.Config.Configuration = filters.Configurations?.ElementAtOrDefault(i); + package.Config.Target = filters.Targets?.ElementAtOrDefault(i); } i = filters.Frameworks != null && package.PackageVersion.Framework != null ? Array.IndexOf(filters.Frameworks, package.PackageVersion.Framework) : -1; if (i >= 0) { - package.Config.Version = filters.Versions?.ElementAtOrDefault(i) ?? package.PackageVersion.Version; - package.Config.Branch = filters.Branches?.ElementAtOrDefault(i) ?? package.PackageVersion.Branch; - package.Config.Configuration = filters.Configurations?.ElementAtOrDefault(i) ?? package.PackageVersion.Configuration; - package.Config.Target = filters.Targets?.ElementAtOrDefault(i) ?? package.PackageVersion.Target; + package.Config.Version = filters.Versions?.ElementAtOrDefault(i); + package.Config.Branch = filters.Branches?.ElementAtOrDefault(i); + package.Config.Configuration = filters.Configurations?.ElementAtOrDefault(i); + package.Config.Target = filters.Targets?.ElementAtOrDefault(i); } }