@@ -110,6 +110,10 @@ public IReadOnlyCollection<IFile> Install(PackageReference package, PackageType
110
110
{
111
111
toolLocation = "global" ;
112
112
}
113
+ else if ( package . Parameters . ContainsKey ( "local" ) )
114
+ {
115
+ toolLocation = "local" ;
116
+ }
113
117
114
118
// First we need to check if the Tool is already installed
115
119
var installedTools = GetInstalledTools ( toolLocation ) ;
@@ -163,7 +167,15 @@ public IReadOnlyCollection<IFile> Install(PackageReference package, PackageType
163
167
private List < DotNetToolPackage > GetInstalledTools ( string toolLocation )
164
168
{
165
169
var toolLocationArgument = string . Empty ;
166
- if ( toolLocation != "global" )
170
+ if ( toolLocation == "global" )
171
+ {
172
+ toolLocationArgument = "--global" ;
173
+ }
174
+ else if ( toolLocation == "local" )
175
+ {
176
+ toolLocationArgument = "--local" ;
177
+ }
178
+ else
167
179
{
168
180
toolLocationArgument = string . Format ( "--tool-path \" {0}\" " , toolLocation ) ;
169
181
var toolLocationDirectoryPath = new DirectoryPath ( toolLocation ) . MakeAbsolute ( _environment ) ;
@@ -177,10 +189,6 @@ private List<DotNetToolPackage> GetInstalledTools(string toolLocation)
177
189
return new List < DotNetToolPackage > ( ) ;
178
190
}
179
191
}
180
- else
181
- {
182
- toolLocationArgument = "--global" ;
183
- }
184
192
185
193
var isInstalledProcess = _processRunner . Start (
186
194
"dotnet" ,
@@ -196,7 +204,7 @@ private List<DotNetToolPackage> GetInstalledTools(string toolLocation)
196
204
var installedTools = isInstalledProcess . GetStandardOutput ( ) . ToList ( ) ;
197
205
var installedToolNames = new List < DotNetToolPackage > ( ) ;
198
206
199
- const string pattern = @"(?<packageName>[^\s]+)\s+(?<packageVersion>[^\s]+)\s+(?<packageShortCode>[^`s]) " ;
207
+ const string pattern = @"(?<packageName>[^\s]+)\s+(?<packageVersion>[^\s]+)\s+(?<packageShortCode>[^\s]+)(?:\s+(?<packageManifest>[^\s]+))? " ;
200
208
201
209
foreach ( var installedTool in installedTools . Skip ( 2 ) )
202
210
{
@@ -207,7 +215,8 @@ private List<DotNetToolPackage> GetInstalledTools(string toolLocation)
207
215
{
208
216
Id = match . Groups [ "packageName" ] . Value ,
209
217
Version = match . Groups [ "packageVersion" ] . Value ,
210
- ShortCode = match . Groups [ "packageShortCode" ] . Value
218
+ ShortCode = match . Groups [ "packageShortCode" ] . Value ,
219
+ Manifest = match . Groups [ "packageManifest" ] . Value
211
220
} ) ;
212
221
}
213
222
}
@@ -237,7 +246,7 @@ private void RunDotNetTool(PackageReference package, DirectoryPath toolsFolderDi
237
246
{
238
247
_log . Warning ( "dotnet exited with {0}" , exitCode ) ;
239
248
var output = string . Join ( Environment . NewLine , process . GetStandardError ( ) ) ;
240
- _log . Verbose ( Verbosity . Diagnostic , "Output:\r \n {0}" , output ) ;
249
+ _log . Verbose ( Verbosity . Diagnostic , "Output:{0}{1}" , Environment . NewLine , output ) ;
241
250
}
242
251
}
243
252
@@ -257,12 +266,23 @@ private static ProcessArgumentBuilder GetArguments(
257
266
{
258
267
arguments . Append ( "--global" ) ;
259
268
}
269
+ else if ( definition . Parameters . ContainsKey ( "local" ) )
270
+ {
271
+ arguments . Append ( "--local" ) ;
272
+ }
260
273
else
261
274
{
262
275
arguments . Append ( "--tool-path" ) ;
263
276
arguments . AppendQuoted ( toolDirectoryPath . FullPath ) ;
264
277
}
265
278
279
+ // Tool manifest
280
+ if ( definition . Parameters . ContainsKey ( "tool-manifest" ) )
281
+ {
282
+ arguments . Append ( "--tool-manifest" ) ;
283
+ arguments . AppendQuoted ( definition . Parameters [ "tool-manifest" ] . First ( ) ) ;
284
+ }
285
+
266
286
if ( operation != DotNetToolOperation . Uninstall )
267
287
{
268
288
if ( definition . Address != null )
0 commit comments