chore: format and clean up

This commit is contained in:
JNIH
2026-07-30 20:19:01 +02:00
parent c953ca8460
commit 00deea0ca1
21 changed files with 1134 additions and 971 deletions
+8 -3
View File
@@ -24,9 +24,9 @@ function Confirm-Continue {
Write-Host "It will keep the trusted certificate because -KeepCertificate was used."
}
if ($removeUserDataNow) {
Write-Host "It will also remove Olive local settings and cached GIFs."
Write-Host "It will also remove Olive user data."
} else {
Write-Host "It will keep Olive local settings and cached GIFs because -KeepUserData was used."
Write-Host "It will keep Olive user data because -KeepUserData was used."
}
$answer = Read-Host "Continue? Type YES"
if ($answer -ne "YES") {
@@ -87,7 +87,6 @@ if ($packages.Count -eq 0) {
if (-not $KeepUserData) {
$localAppData = [Environment]::GetFolderPath([Environment+SpecialFolder]::LocalApplicationData)
$userDataPaths = @(
(Join-Path $localAppData "Olive"),
(Join-Path $localAppData "Microsoft\PowerToys\CommandPalette\Extensions\Olive"),
(Join-Path $localAppData "Microsoft\PowerToys\CommandPalette\Settings\Olive"),
(Join-Path $localAppData "Microsoft\PowerToys\CommandPalette\Olive")
@@ -97,6 +96,12 @@ if (-not $KeepUserData) {
$userDataPaths += Join-Path $localAppData "Packages\$packageFamilyName"
}
$packagesRoot = Join-Path $localAppData "Packages"
if (Test-Path -LiteralPath $packagesRoot) {
$userDataPaths += Get-ChildItem -LiteralPath $packagesRoot -Directory -Filter "Olive_*" |
ForEach-Object { $_.FullName }
}
foreach ($path in ($userDataPaths | Sort-Object -Unique)) {
Remove-DirectoryIfExists -Path $path
}