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

chore(windows/install): general improvement #548

Merged
merged 5 commits into from
Jul 13, 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
20 changes: 12 additions & 8 deletions resources/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ if (-not (Get-Command -Name spicetify -ErrorAction SilentlyContinue)) {
Invoke-WebRequest @Parameters | Invoke-Expression
}

$spiceUserDataPath = "$env:APPDATA\spicetify"
$spiceUserDataPath = spicetify path userdata
if ($LASTEXITCODE) {
Write-Host -Object "Something is wrong with your Spicetify installation. Check the message below." -ForegroundColor Red
throw $spiceUserDataPath
}
$marketAppPath = "$spiceUserDataPath\CustomApps\marketplace"
$marketThemePath = "$spiceUserDataPath\Themes\marketplace"
$isMarketplaceInstalled = (
((spicetify config custom_apps) -contains 'marketplace') -and (Test-Path -Path $marketAppPath -PathType Container)
$isThemeInstalled = $(
spicetify path -s | Out-Null
-not $LASTEXITCODE
)

Write-Host -Object 'Removing and creating Marketplace folders...' -ForegroundColor Cyan
Expand Down Expand Up @@ -50,12 +55,11 @@ $Parameters = @{
Invoke-WebRequest @Parameters

Write-Host -Object 'Applying...' -ForegroundColor Cyan
if (-not $isMarketplaceInstalled) {
if (-not $isThemeInstalled) {
spicetify config current_theme marketplace
}
spicetify backup
spicetify restore
spicetify backup
spicetify backup -q
spicetify apply

Write-Host -Object 'Done! If nothing has happened, do spicetify apply' -ForegroundColor Green
Write-Host -Object 'Done!' -ForegroundColor Green
Write-Host -Object 'If nothing has happened, check the messages above for errors'