mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 05:15:10 +00:00
fix(windows): address code review issues
- Fix openInExplorer to actually execute explorer.exe (was a no-op) - Load System.Windows.Forms assembly before using Clipboard - Use Remove-SafeItem in purge for consistent safety checks - Fix Dropbox typo (was DroplboxCache)
This commit is contained in:
@@ -473,20 +473,16 @@ function Remove-ProjectArtifacts {
|
||||
|
||||
foreach ($artifact in $project.Artifacts) {
|
||||
if (Test-Path $artifact.Path) {
|
||||
try {
|
||||
if ($artifact.Type -eq "Directory") {
|
||||
Remove-Item -Path $artifact.Path -Recurse -Force -ErrorAction Stop
|
||||
}
|
||||
else {
|
||||
Remove-Item -Path $artifact.Path -Force -ErrorAction Stop
|
||||
}
|
||||
|
||||
# Use safe removal with protection checks
|
||||
$result = Remove-SafeItem -Path $artifact.Path -Description $artifact.Name -Recurse
|
||||
|
||||
if ($result.Removed -gt 0) {
|
||||
Write-Host " $esc[32m$($script:Icons.Success)$esc[0m $($artifact.Name) ($($artifact.SizeHuman))"
|
||||
$script:TotalSizeCleaned += $artifact.SizeKB
|
||||
$script:ItemsCleaned++
|
||||
}
|
||||
catch {
|
||||
Write-Host " $esc[31m$($script:Icons.Error)$esc[0m $($artifact.Name) - $_"
|
||||
elseif ($result.Failed -gt 0) {
|
||||
Write-Host " $esc[31m$($script:Icons.Error)$esc[0m $($artifact.Name) - removal failed"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user