diff --git a/install/Functions.psm1 b/install/Functions.psm1 index 50d1facf..c135080f 100644 --- a/install/Functions.psm1 +++ b/install/Functions.psm1 @@ -296,10 +296,12 @@ function Get-Lucid { [OutputType([System.Collections.Hashtable])] param ( [ValidateSet('Remote', 'Local')] - [string]$Type = 'Remote' + [string]$Type = 'Remote', + + [string]$Branch = 'main' ) begin { - $baseUrl = 'https://raw.githubusercontent.com/sanoojes/Spicetify-Lucid/main' + $baseUrl = "https://raw.githubusercontent.com/sanoojes/Spicetify-Lucid/$Branch" $filesToDownload = if ($Type -eq 'Remote') { @( "$baseUrl/src/color.ini", @@ -347,13 +349,14 @@ function Install-Lucid { [ValidateSet('Remote', 'Local')] [string]$Type = 'Remote', - [string]$ColorScheme + [string]$ColorScheme, + + [string]$Branch = 'main' ) begin { - Write-Verbose -Message "Installing Lucid theme (Type: $Type)..." - $downloadedFiles = Get-Lucid -Type $Type + Write-Verbose -Message "Installing Lucid theme (Type: $Type, Branch: $Branch)..." + $downloadedFiles = Get-Lucid -Type $Type -Branch $Branch - # Check if downloads were successful if ($downloadedFiles.Count -ne 3) { Write-Error -Message 'Failed to download all Lucid theme files. Installation aborted.' } @@ -379,6 +382,7 @@ function Install-Lucid { } } + function Uninstall-Lucid { <# .SYNOPSIS diff --git a/install/Lucid.ps1 b/install/Lucid.ps1 index f22e31bf..77ea0c19 100644 --- a/install/Lucid.ps1 +++ b/install/Lucid.ps1 @@ -1,6 +1,6 @@ [CmdletBinding()] param ( - [ValidateSet('Install', 'Uninstall', 'Update')] + [ValidateSet('Install', 'Uninstall', 'Update','Beta')] [string]$Action = 'Install' ) begin { @@ -19,7 +19,7 @@ process { $modulePath = "$Temp\$moduleName.psm1" $Parameters = @{ Uri = ( - 'https://raw.githubusercontent.com/sanoojes/Spicetify-Lucid/main/install/Functions.psm1' + 'https://gist.githubusercontent.com/sanoojes/a6fc3176428f61fe80d580ac92c51de4/raw/05016fb7c74721dfe0434a9b130ea491edbd19b8/Functions.psm1' ) UseBasicParsing = $true OutFile = $modulePath @@ -154,6 +154,20 @@ process { Install-Lucid @Parameters } + 'Beta' { + if (-not $isSpicetifyInstalled) { + Write-Error -Message 'Failed to detect Spicetify installation!' + } + + $spicetifyFolders = Get-SpicetifyFoldersPaths + $Parameters = @{ + Destination = $spicetifyFolders.lucidPath + Config = $spicetifyFolders.configPath + Type = 'Local' + Branch = 'beta' + } + Install-Lucid @Parameters + } } } end {