Skip to content

Commit

Permalink
chore(install): change wording for admin/root (#3051)
Browse files Browse the repository at this point in the history
  • Loading branch information
rxri authored May 29, 2024
1 parent 5760cfc commit 94b1f3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function Test-Admin {
[CmdletBinding()]
param ()
begin {
Write-Host -Object "Checking if the script wasn't ran as Administrator..." -NoNewline
Write-Host -Object "Checking if the script is not being run as administrator..." -NoNewline
}
process {
$currentUser = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
Expand Down Expand Up @@ -64,8 +64,8 @@ function Get-Spicetify {
[CmdletBinding()]
param ()
begin {
if ($env:PROCESSOR_ARCHITECTURE -eq 'AMD64') {
$architecture = 'x64'
if ($env:PROCESSOR_ARCHITECTURE -eq 'AMD64') {
$architecture = 'x64'
}
elseif ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') {
$architecture = 'arm64'
Expand Down Expand Up @@ -165,13 +165,13 @@ else {
}
if (-not (Test-Admin)) {
Write-Unsuccess
Write-Warning -Message "The script was ran as Administrator which isn't recommended"
Write-Warning -Message "The script was run as administrator. This can result in problems with the installation process or unexpected behavior. Do not continue if you do not know what you are doing."
$Host.UI.RawUI.Flushinputbuffer()
$choices = [System.Management.Automation.Host.ChoiceDescription[]] @(
(New-Object System.Management.Automation.Host.ChoiceDescription '&Yes', 'Abort installation.'),
(New-Object System.Management.Automation.Host.ChoiceDescription '&No', 'Resume installation.')
)
$choice = $Host.UI.PromptForChoice('', 'Do you want to abort the installation process to avoid any issues?', $choices, 0)
$choice = $Host.UI.PromptForChoice('', 'Do you want to abort the installation process?', $choices, 0)
if ($choice -eq 0) {
Write-Host -Object 'spicetify installation aborted' -ForegroundColor 'Yellow'
Pause
Expand All @@ -197,7 +197,7 @@ $choices = [System.Management.Automation.Host.ChoiceDescription[]] @(
(New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", "Install Spicetify Marketplace."),
(New-Object System.Management.Automation.Host.ChoiceDescription "&No", "Do not install Spicetify Marketplace.")
)
$choice = $Host.UI.PromptForChoice('', "`nDo you want to install Spicetify Marketplace?", $choices, 0)
$choice = $Host.UI.PromptForChoice('', "`nDo you also want to install Spicetify Marketplace? It will become available within the Spotify client, where you can easily install themes and extensions.", $choices, 0)
if ($choice -eq 1) {
Write-Host -Object 'spicetify Marketplace installation aborted' -ForegroundColor 'Yellow'
}
Expand Down
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ is_root() {
}

if ! is_root && [ "${override_root:-0}" -eq 0 ]; then
echo "The script was ran as root. Script will now exit"
echo "If you did not intend to do this, please run the script without root permissions to avoid issues with Spicetify"
echo "You can override this behavior by passing '--root' flag to this script"
echo "The script was ran under sudo or as root. The script will now exit"
echo "If you hadn't intended to do this, please execute the script without root access to avoid problems with spicetify"
echo "To override this behavior, pass the '--root' parameter to this script"
exit
fi

Expand Down

0 comments on commit 94b1f3f

Please sign in to comment.