chore: format and clean up
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user