Skip to content

Commit 740322f

Browse files
fix(psmodules): Remove folder recursively when unlinking previous module path (#5127)
* Update psmodules.ps1 * Update CHANGELOG.md * Update CHANGELOG.md [skip ci] Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
1 parent e06c7f0 commit 740322f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
### Bug Fixes
1212

1313
- **config:** Change config option to snake_case in file and SCREAMING_CASE in code ([#5116](https://github.com/ScoopInstaller/Scoop/issues/5116))
14+
- **psmodule:** Remove folder recursively when unlinking previous module path ([#5127](https://github.com/ScoopInstaller/Scoop/issues/5127))
1415

1516
### Code Refactoring
1617

lib/psmodules.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function install_psmodule($manifest, $dir, $global) {
2323

2424
if (Test-Path $linkfrom) {
2525
warn "$(friendly_path $linkfrom) already exists. It will be replaced."
26-
Remove-Item -Path $linkfrom -Force -ErrorAction SilentlyContinue
26+
Remove-Item -Path $linkfrom -Force -Recurse -ErrorAction SilentlyContinue
2727
}
2828

2929
New-DirectoryJunction $linkfrom $dir | Out-Null
@@ -40,7 +40,7 @@ function uninstall_psmodule($manifest, $dir, $global) {
4040
if (Test-Path $linkfrom) {
4141
Write-Host "Removing $(friendly_path $linkfrom)"
4242
$linkfrom = Convert-Path $linkfrom
43-
Remove-Item -Path $linkfrom -Force -ErrorAction SilentlyContinue
43+
Remove-Item -Path $linkfrom -Force -Recurse -ErrorAction SilentlyContinue
4444
}
4545
}
4646

0 commit comments

Comments
 (0)