Merge pull request #877 from Sridhar-MS/restore-temp-remove
Delete temporary folder created by "dotnet restore".
This commit is contained in:
commit
a64f8f6310
1 changed files with 12 additions and 6 deletions
|
@ -110,15 +110,21 @@ namespace Microsoft.DotNet.Tools.Restore
|
|||
|
||||
private static void RestoreTool(LibraryRange tooldep, RestoreTask restoreTask)
|
||||
{
|
||||
var tempPath = Path.Combine(restoreTask.ProjectDirectory, Guid.NewGuid().ToString(), "bin");
|
||||
var tempRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
|
||||
try
|
||||
{
|
||||
var tempPath = Path.Combine(tempRoot, "bin");
|
||||
|
||||
RestoreToolToPath(tooldep, restoreTask.Arguments, tempPath);
|
||||
|
||||
CreateDepsInPackageCache(tooldep, tempPath);
|
||||
|
||||
PersistLockFile(tooldep, tempPath, restoreTask.ProjectDirectory);
|
||||
|
||||
Directory.Delete(tempPath, true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Directory.Delete(tempRoot, true);
|
||||
}
|
||||
}
|
||||
|
||||
private static void PersistLockFile(LibraryRange tooldep, string tempPath, string projectPath)
|
||||
|
|
Loading…
Add table
Reference in a new issue