aboutsummaryrefslogtreecommitdiff
path: root/website
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-09 16:41:34 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-09 16:41:34 +0300
commit698eb51f543af47ba7a974d0d78f1bf0cca2cd53 (patch)
treecdc3eaecb620dbab7a27ad074c49e0c063ab37f1 /website
parent052cff9864edffaab62f3e09dd28e5456cb1b767 (diff)
fix: migrate legacy windows bin backups
Diffstat (limited to 'website')
-rw-r--r--website/install.ps110
1 files changed, 7 insertions, 3 deletions
diff --git a/website/install.ps1 b/website/install.ps1
index 66f9a8c9..ccf08239 100644
--- a/website/install.ps1
+++ b/website/install.ps1
@@ -213,14 +213,14 @@ function Set-ManagedJunction {
if ($existingTarget.Equals($TargetPath, [System.StringComparison]::OrdinalIgnoreCase)) {
return
}
- Remove-Item -LiteralPath $LinkPath -Force
+ Remove-Item -LiteralPath $LinkPath -Recurse -Force
} elseif ($item.PSIsContainer) {
if ((Get-ChildItem -LiteralPath $LinkPath -Force | Select-Object -First 1) -ne $null) {
if (-not (Move-LegacyHerdrBinDirectory -Path $LinkPath -AllowMigration $AllowLegacyHerdrBinMigration)) {
throw "Refusing to replace non-empty directory at $LinkPath with a junction."
}
} else {
- Remove-Item -LiteralPath $LinkPath -Force
+ Remove-Item -LiteralPath $LinkPath -Recurse -Force
}
} else {
throw "Refusing to replace file at $LinkPath with a junction."
@@ -242,7 +242,11 @@ function Move-LegacyHerdrBinDirectory {
}
$entries = @(Get-ChildItem -LiteralPath $Path -Force)
- if ($entries.Count -ne 1 -or $entries[0].PSIsContainer -or $entries[0].Name -ine "herdr.exe") {
+ if (($entries | Where-Object { $_.PSIsContainer } | Select-Object -First 1) -ne $null) {
+ return $false
+ }
+
+ if (($entries | Where-Object { $_.Name -ieq "herdr.exe" } | Select-Object -First 1) -eq $null) {
return $false
}