Skip to content

Commit b738f3c

Browse files
committed
[FIX] tools: Save packages with lowercase names
1 parent 3f06bb6 commit b738f3c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Cli/dotnet/commands/dotnet-pack/PackCommandParser.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ internal static class PackCommandParser
5353

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

56+
public static readonly CliOption<string[]> LowercaseVersion = new ForwardedOption<String[]>("--property", "-property", "/property", "/p", "-p", "--p")
57+
.SetForwardingFunction((optionVals) =>
58+
optionVals
59+
.SelectMany(Microsoft.DotNet.Cli.Utils.MSBuildPropertyParser.ParseProperties)
60+
.Where(o => o.key.Equals("Version", StringComparison.OrdinalIgnoreCase))
61+
.Select(keyValue => $"--property:{keyValue.key}={keyValue.value.ToLowerInvariant()}")
62+
).AllowSingleArgPerToken();
63+
5664
private static readonly CliCommand Command = ConstructCommand();
5765

5866
public static CliCommand GetCommand()
@@ -78,6 +86,7 @@ private static CliCommand ConstructCommand()
7886
command.Options.Add(CommonOptions.VersionSuffixOption);
7987
command.Options.Add(ConfigurationOption);
8088
command.Options.Add(CommonOptions.DisableBuildServersOption);
89+
command.Options.Add(LowercaseVersion);
8190
RestoreCommandParser.AddImplicitRestoreOptions(command, includeRuntimeOption: true, includeNoDependenciesOption: true);
8291

8392
command.SetAction(PackCommand.Run);

0 commit comments

Comments
 (0)