![Livar Cunha](/assets/img/avatar_default.png)
- Created a Configurer class that is responsible for deciding when to run the dotnet first time use experience and invoke the NuGetCachePrimer. - Added the NuGetCachePrimer which extract the archive and primes the cache. -- This is just missing creating the sentinel once restore succeeds. - Added a shell for the NugetPackagesArchiver, which will be responsible for expanding the archive (likely replaced in the future by an abstraction from Eric's code or its implementation will simply call Eric's code). - Added a TemporaryFolder abstration to Internal Abstractions that handles deleting the temporary folder once we are done with it.
31 lines
853 B
C#
31 lines
853 B
C#
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
using Microsoft.Extensions.EnvironmentAbstractions;
|
|
using System.IO;
|
|
|
|
namespace Microsoft.DotNet.InternalAbstractions
|
|
{
|
|
internal class TemporaryDirectory : ITemporaryDirectory
|
|
{
|
|
public string DirectoryPath { get; }
|
|
|
|
public TemporaryDirectory()
|
|
{
|
|
DirectoryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
|
|
Directory.CreateDirectory(DirectoryPath);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
try
|
|
{
|
|
Directory.Delete(DirectoryPath, true);
|
|
}
|
|
catch
|
|
{
|
|
// Ignore failures here.
|
|
}
|
|
}
|
|
}
|
|
}
|