Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(windows/install): preserve current_theme on update #526

Merged
merged 1 commit into from
Jun 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion resources/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ $download_uri = "https://github.com/spicetify/spicetify-marketplace/releases/dow

Invoke-WebRequest -Uri $download_uri -UseBasicParsing -OutFile "$sp_dot_dir\marketplace.zip"

$isMarketplaceInstalled = (
((spicetify config custom_apps) -contains "marketplace") -and (Test-Path -Path "$sp_dot_dir\marketplace" -PathType Container)
)

Write-Host "Unzipping and installing..." -ForegroundColor "Green"
Expand-Archive -Path "$sp_dot_dir\marketplace.zip" -DestinationPath $sp_dot_dir -Force
Remove-Item -Path "$sp_dot_dir\marketplace.zip" -Force
Expand All @@ -46,7 +50,10 @@ Write-Host "Applying placeholder theme..." -ForegroundColor "Cyan"
Remove-Item -Recurse -Force "$spicePath\Themes\marketplace" -ErrorAction Ignore
New-Item -Path "$spicePath\Themes\marketplace" -ItemType Directory | Out-Null
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/spicetify/spicetify-marketplace/main/resources/color.ini" -OutFile "$spicePath\Themes\marketplace\color.ini"
spicetify config current_theme marketplace

if (-not $isMarketplaceInstalled) {
spicetify config current_theme marketplace
}

spicetify backup
spicetify apply
Expand Down