Skip to content

Commit

Permalink
Delete tool folder before installing
Browse files Browse the repository at this point in the history
helps clear out any stale previous installation attempts
  • Loading branch information
Noggog committed Jan 22, 2025
1 parent 781ed31 commit d57255e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.IO.Abstractions;
using Noggog;
using Noggog.Processes.DI;
using NuGet.Packaging.Core;
Expand All @@ -9,17 +10,20 @@ namespace Spriggit.Engine.Services.Singletons;
public class ConstructDotNetToolEndpoint
{
private readonly ILogger _logger;
private readonly IFileSystem _fileSystem;
private readonly ProcessFactory _processFactory;
private readonly DotNetToolTranslationPackagePathProvider _pathProvider;
private readonly SpriggitTempSourcesProvider _tempSourcesProvider;

public ConstructDotNetToolEndpoint(
ILogger logger,
IFileSystem fileSystem,
ProcessFactory processFactory,
DotNetToolTranslationPackagePathProvider pathProvider,
SpriggitTempSourcesProvider tempSourcesProvider)
{
_logger = logger;
_fileSystem = fileSystem;
_processFactory = processFactory;
_pathProvider = pathProvider;
_tempSourcesProvider = tempSourcesProvider;
Expand Down Expand Up @@ -65,6 +69,7 @@ private async Task<bool> IsToolInstalled(
{
try
{
_fileSystem.Directory.DeleteEntireFolder(toolsPath);
var args = $"tool install {ident.Id} --version {ident.Version} --tool-path \"{toolsPath}\"";
_logger.Information("Running DotNet Entry point install with Args: {Args}", args);
using var processWrapper = _processFactory.Create(
Expand Down

0 comments on commit d57255e

Please sign in to comment.