Skip to content

Commit 30ffbb0

Browse files
author
Jason Zhai
committed
Merge branch 'release/8.0.2xx'
2 parents fe73553 + b205928 commit 30ffbb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+812
-550
lines changed

eng/restore-toolset.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function CleanOutStage0ToolsetsAndRuntimes {
154154
Remove-Item (Join-Path $aspnetRuntimePath "$majorVersion.*") -Recurse
155155
Remove-Item (Join-Path $coreRuntimePath "$majorVersion.*") -Recurse
156156
Remove-Item (Join-Path $wdRuntimePath "$majorVersion.*") -Recurse
157-
Remove-Item (Join-Path $sdkPath "$majorVersion.*") -Recurse
157+
Remove-Item (Join-Path $sdkPath "*") -Recurse
158158
Remove-Item (Join-Path $dotnetRoot "packs") -Recurse
159159
Remove-Item (Join-Path $dotnetRoot "sdk-manifests") -Recurse
160160
Remove-Item (Join-Path $dotnetRoot "templates") -Recurse

eng/restore-toolset.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function CleanOutStage0ToolsetsAndRuntimes {
9494
local aspnetRuntimePath="$dotnetRoot/shared/Microsoft.AspNetCore.App/$majorVersion.*"
9595
local coreRuntimePath="$dotnetRoot/shared/Microsoft.NETCore.App/$majorVersion.*"
9696
local wdRuntimePath="$dotnetRoot/shared/Microsoft.WindowsDesktop.App/$majorVersion.*"
97-
local sdkPath="$dotnetRoot/sdk/$majorVersion.*"
97+
local sdkPath="$dotnetRoot/sdk/*"
9898

9999
if [ -f "$versionPath" ]; then
100100
local lastInstalledSDK=$(cat $versionPath)

src/Cli/dotnet/commands/dotnet-tool/install/LocalizableStrings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,7 @@ If you would like to create a manifest, use `dotnet new tool-manifest`, usually
235235
<data name="CreateManifestIfNeededOptionDescription" xml:space="preserve">
236236
<value>Create a tool manifest if one isn't found during tool installation. For information on how manifests are located, see https://aka.ms/dotnet/tools/create-manifest-if-needed</value>
237237
</data>
238+
<data name="AllowPackageDowngradeOptionDescription" xml:space="preserve">
239+
<value>Allow package downgrade when installing a .NET tool package.</value>
240+
</data>
238241
</root>

src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallCommandParser.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ internal static class ToolInstallCommandParser
4848
Description = LocalizableStrings.CreateManifestIfNeededOptionDescription
4949
};
5050

51+
public static readonly CliOption<bool> AllowPackageDowngradeOption = new("--allow-downgrade")
52+
{
53+
Description = LocalizableStrings.AllowPackageDowngradeOptionDescription
54+
};
55+
5156
public static readonly CliOption<VerbosityOptions> VerbosityOption = CommonOptions.VerbosityOption;
5257

5358
// Don't use the common options version as we don't want this to be a forwarded option
@@ -77,6 +82,19 @@ private static CliCommand ConstructCommand()
7782
{
7883
CliCommand command = new("install", LocalizableStrings.CommandDescription);
7984

85+
AddCommandOptions(command);
86+
87+
command.Options.Add(ArchitectureOption);
88+
command.Options.Add(CreateManifestIfNeededOption);
89+
command.Options.Add(AllowPackageDowngradeOption);
90+
91+
command.SetAction((parseResult) => new ToolInstallCommand(parseResult).Execute());
92+
93+
return command;
94+
}
95+
96+
public static CliCommand AddCommandOptions(CliCommand command)
97+
{
8098
command.Arguments.Add(PackageIdArgument);
8199
command.Options.Add(GlobalOption.WithHelpDescription(command, LocalizableStrings.GlobalOptionDescription));
82100
command.Options.Add(LocalOption.WithHelpDescription(command, LocalizableStrings.LocalOptionDescription));
@@ -93,12 +111,7 @@ private static CliCommand ConstructCommand()
93111
command.Options.Add(ToolCommandRestorePassThroughOptions.NoHttpCacheOption);
94112
command.Options.Add(ToolCommandRestorePassThroughOptions.InteractiveRestoreOption);
95113
command.Options.Add(VerbosityOption);
96-
command.Options.Add(ArchitectureOption);
97-
command.Options.Add(CreateManifestIfNeededOption);
98-
99-
command.SetAction((parseResult) => new ToolInstallCommand(parseResult).Execute());
100-
101114
return command;
102-
}
115+
}
103116
}
104117
}

0 commit comments

Comments
 (0)