Skip to content

Commit

Permalink
[FIX] tools: Save packages with lowercase names
Browse files Browse the repository at this point in the history
  • Loading branch information
edvilme committed Oct 8, 2024
1 parent 3f06bb6 commit b738f3c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Cli/dotnet/commands/dotnet-pack/PackCommandParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ internal static class PackCommandParser

public static readonly CliOption<string> ConfigurationOption = CommonOptions.ConfigurationOption(LocalizableStrings.ConfigurationOptionDescription);

public static readonly CliOption<string[]> LowercaseVersion = new ForwardedOption<String[]>("--property", "-property", "/property", "/p", "-p", "--p")
.SetForwardingFunction((optionVals) =>
optionVals
.SelectMany(Microsoft.DotNet.Cli.Utils.MSBuildPropertyParser.ParseProperties)
.Where(o => o.key.Equals("Version", StringComparison.OrdinalIgnoreCase))
.Select(keyValue => $"--property:{keyValue.key}={keyValue.value.ToLowerInvariant()}")
).AllowSingleArgPerToken();

private static readonly CliCommand Command = ConstructCommand();

public static CliCommand GetCommand()
Expand All @@ -78,6 +86,7 @@ private static CliCommand ConstructCommand()
command.Options.Add(CommonOptions.VersionSuffixOption);
command.Options.Add(ConfigurationOption);
command.Options.Add(CommonOptions.DisableBuildServersOption);
command.Options.Add(LowercaseVersion);
RestoreCommandParser.AddImplicitRestoreOptions(command, includeRuntimeOption: true, includeNoDependenciesOption: true);

command.SetAction(PackCommand.Run);
Expand Down

0 comments on commit b738f3c

Please sign in to comment.