Skip to content

Commit

Permalink
execute remove operation when file exists instead of just ignore error
Browse files Browse the repository at this point in the history
  • Loading branch information
HUMORCE committed Sep 19, 2024
1 parent 081ef14 commit 963303c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/commands.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ function rm_alias {
}

info "Removing alias '$name'..."
Remove-Item "$(shimdir $false)\scoop-$name.ps1" -ErrorAction SilentlyContinue
if (Test-Path "$(shimdir $false)\scoop-$name.ps1") {
Remove-Item "$(shimdir $false)\scoop-$name.ps1"
}
$aliases.PSObject.Properties.Remove($name)
set_config ALIAS $aliases | Out-Null
}
Expand Down

0 comments on commit 963303c

Please sign in to comment.