Skip to content

Commit

Permalink
fix: update should get latest version if non is given
Browse files Browse the repository at this point in the history
  • Loading branch information
iadonkey committed Sep 18, 2024
1 parent 562c9dd commit d1edf7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions TwinpackCli/Commands/AbstractCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ protected List<PackageItem> 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)
}
});
}
Expand Down
16 changes: 8 additions & 8 deletions TwinpackCore/Core/TwinpackService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,19 +399,19 @@ public async System.Threading.Tasks.Task<List<PackageItem>> 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);
}
}

Expand Down

0 comments on commit d1edf7e

Please sign in to comment.