-
-
Notifications
You must be signed in to change notification settings - Fork 39
/
uninstall.ps1
53 lines (44 loc) · 1.44 KB
/
uninstall.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# GPL license.
# Edited from project Denoland install script (https://github.com/denoland/deno_install)
param (
[string] $version
)
$PSMinVersion = 3
if ($v) {
$version = $v
}
# Helper functions for pretty terminal output.
function Write-Part ([string] $Text) {
Write-Host $Text -NoNewline
}
function Write-Emphasized ([string] $Text) {
Write-Host $Text -NoNewLine -ForegroundColor "Cyan"
}
function Write-Done {
Write-Host " > " -NoNewline
Write-Host "OK" -ForegroundColor "Green"
}
if ($PSVersionTable.PSVersion.Major -gt $PSMinVersion) {
$ErrorActionPreference = "Stop"
# Check ~\.spicetify\Themes directory already exists
$spicePath = spicetify -c | Split-Path
$sp_dot_dir = "$spicePath\Themes"
Write-Part "REMOVING FOLDER "; Write-Emphasized "$sp_dot_dir\Comfy"
Remove-Item -Recurse -Force "$sp_dot_dir\Comfy" -ErrorAction Ignore
Write-Done
spicetify config current_theme " "
spicetify config color_scheme " "
Write-Part "APPLYING";
$configFile = Get-Content "$spicePath\config-xpui.ini"
$backupVer = $configFile -match "^version"
if ($backupVer.Length -gt 0) {
spicetify apply
} else {
spicetify backup apply
}
Write-Done
}
else {
Write-Part "`nYour Powershell version is less than "; Write-Emphasized "$PSMinVersion";
Write-Part "`nPlease, update your Powershell downloading the "; Write-Emphasized "'Windows Management Framework'"; Write-Part " greater than "; Write-Emphasized "$PSMinVersion"
}