12
12
using Microsoft . Extensions . EnvironmentAbstractions ;
13
13
using NuGet . Versioning ;
14
14
using Microsoft . DotNet . Cli . ToolPackage ;
15
+ using Microsoft . DotNet . Cli . NuGetPackageDownloader ;
15
16
16
17
namespace Microsoft . DotNet . Tools . Tool . Update
17
18
{
@@ -38,6 +39,8 @@ internal class ToolUpdateGlobalOrToolPathCommand : CommandBase
38
39
private readonly IEnumerable < string > _forwardRestoreArguments ;
39
40
private readonly string _packageVersion ;
40
41
42
+ internal readonly RestoreActionConfig _restoreActionConfig ;
43
+
41
44
public ToolUpdateGlobalOrToolPathCommand ( ParseResult parseResult ,
42
45
CreateToolPackageStoresAndDownloaderAndUninstaller createToolPackageStoreDownloaderUninstaller = null ,
43
46
CreateShellShimRepository createShellShimRepository = null ,
@@ -60,6 +63,11 @@ public ToolUpdateGlobalOrToolPathCommand(ParseResult parseResult,
60
63
_createShellShimRepository =
61
64
createShellShimRepository ?? ShellShimRepositoryFactory . CreateShellShimRepository ;
62
65
66
+ _restoreActionConfig = new RestoreActionConfig ( DisableParallel : parseResult . GetValue ( ToolCommandRestorePassThroughOptions . DisableParallelOption ) ,
67
+ NoCache : parseResult . GetValue ( ToolCommandRestorePassThroughOptions . NoCacheOption ) ,
68
+ IgnoreFailedSources : parseResult . GetValue ( ToolCommandRestorePassThroughOptions . IgnoreFailedSourcesOption ) ,
69
+ Interactive : parseResult . GetValue ( ToolCommandRestorePassThroughOptions . InteractiveRestoreOption ) ) ;
70
+
63
71
_reporter = ( reporter ?? Reporter . Output ) ;
64
72
_errorReporter = ( reporter ?? Reporter . Error ) ;
65
73
}
@@ -111,7 +119,8 @@ public override int Execute()
111
119
versionRange : versionRange ,
112
120
targetFramework : _framework ,
113
121
verbosity : _verbosity ,
114
- isGlobalTool : true
122
+ isGlobalTool : true ,
123
+ restoreActionConfig : _restoreActionConfig
115
124
) ;
116
125
117
126
EnsureVersionIsHigher ( oldPackageNullable , newInstalledPackage ) ;
0 commit comments