diff --git a/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateCommand.cs b/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateCommand.cs index 42b9dd56417e..1499142be4c0 100644 --- a/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-tool/update/ToolUpdateCommand.cs @@ -8,7 +8,6 @@ using Microsoft.DotNet.ToolManifest; using Microsoft.DotNet.ToolPackage; using Microsoft.DotNet.Tools.Tool.Common; -using Microsoft.Extensions.EnvironmentAbstractions; using CreateShellShimRepository = Microsoft.DotNet.Tools.Tool.Install.CreateShellShimRepository; namespace Microsoft.DotNet.Tools.Tool.Update @@ -44,17 +43,16 @@ public ToolUpdateCommand( localToolsResolverCache, reporter); - _global = result.GetValue(ToolInstallCommandParser.GlobalOption); - _toolPath = result.GetValue(ToolInstallCommandParser.ToolPathOption); - DirectoryPath? location = string.IsNullOrWhiteSpace(_toolPath) ? null : new DirectoryPath(_toolPath); _toolUpdateGlobalOrToolPathCommand = toolUpdateGlobalOrToolPathCommand ?? new ToolUpdateGlobalOrToolPathCommand( result, createToolPackageStoreDownloaderUninstaller, createShellShimRepository, - reporter, - ToolPackageFactory.CreateToolPackageStoreQuery(location)); + reporter); + + _global = result.GetValue(ToolInstallCommandParser.GlobalOption); + _toolPath = result.GetValue(ToolInstallCommandParser.ToolPathOption); }