diff --git a/internal/installcmd/resolver.go b/internal/installcmd/resolver.go index a3023c066..b1d9e565b 100644 --- a/internal/installcmd/resolver.go +++ b/internal/installcmd/resolver.go @@ -262,6 +262,7 @@ func resolveGGAInstall(profile system.PlatformProfile) (CommandSequence, error) }, nil case "apt", "pacman", "dnf": const tmpDir = "/tmp/gentleman-guardian-angel" + _ = os.RemoveAll(tmpDir) return CommandSequence{ {"rm", "-rf", tmpDir}, {"git", "clone", "https://github.com/Gentleman-Programming/gentleman-guardian-angel.git", tmpDir}, @@ -274,6 +275,7 @@ func resolveGGAInstall(profile system.PlatformProfile) (CommandSequence, error) // PowerShell is used for cleanup to avoid cmd.exe quoting issues with // embedded double quotes in the "if exist ... rmdir" approach. cloneDst := filepath.Join(os.TempDir(), "gentleman-guardian-angel") + _ = os.RemoveAll(cloneDst) bash := gitBashPath() return CommandSequence{ {"powershell", "-NoProfile", "-Command", fmt.Sprintf("Remove-Item -Recurse -Force -ErrorAction SilentlyContinue '%s'; exit 0", cloneDst)},