Skip to content

Commit

Permalink
✨ feat: add Beta to Powershell installation
Browse files Browse the repository at this point in the history
  • Loading branch information
sanoojes committed Oct 5, 2024
1 parent 4b30fb5 commit 0bf0437
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
16 changes: 10 additions & 6 deletions install/Functions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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.'
}
Expand All @@ -379,6 +382,7 @@ function Install-Lucid {
}
}


function Uninstall-Lucid {
<#
.SYNOPSIS
Expand Down
18 changes: 16 additions & 2 deletions install/Lucid.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[CmdletBinding()]
param (
[ValidateSet('Install', 'Uninstall', 'Update')]
[ValidateSet('Install', 'Uninstall', 'Update','Beta')]
[string]$Action = 'Install'
)
begin {
Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 0bf0437

Please sign in to comment.