diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c02b1e..e5dc756 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.0.5 + +- Fixed the Windows installer so pnpm warnings no longer get treated as a failed build. +- Updated command handling to prefer native `.cmd` shims instead of PowerShell package-manager shims. + ## 1.0.4 - Added a Discord-styled progress window for update installs. diff --git a/SpotifyLyricsStatus.plugin.js b/SpotifyLyricsStatus.plugin.js index 7f8db3b..88a0f21 100644 --- a/SpotifyLyricsStatus.plugin.js +++ b/SpotifyLyricsStatus.plugin.js @@ -2,7 +2,7 @@ * @name DiscordLyrics * @author mally * @description Sets your Discord custom status to the current synced lyric from Spotify, or a pause status when playback stops. - * @version 1.0.4 + * @version 1.0.5 * @source https://lrclib.net */ @@ -14,7 +14,7 @@ const { execFile, spawn } = require("child_process"); module.exports = class DiscordLyrics { constructor() { this.name = "DiscordLyrics"; - this.version = "1.0.4"; + this.version = "1.0.5"; this.repo = "MallyDev2/DiscordLyrics"; this.latestReleaseApi = `https://api.github.com/repos/${this.repo}/releases/latest`; this.interval = null; diff --git a/dist/DiscordLyrics-Installer.exe b/dist/DiscordLyrics-Installer.exe index e9e1def..a81f4e6 100644 Binary files a/dist/DiscordLyrics-Installer.exe and b/dist/DiscordLyrics-Installer.exe differ diff --git a/dist/DiscordLyrics-Installer.ps1 b/dist/DiscordLyrics-Installer.ps1 index 10cc804..589ccb9 100644 --- a/dist/DiscordLyrics-Installer.ps1 +++ b/dist/DiscordLyrics-Installer.ps1 @@ -111,13 +111,31 @@ function Resolve-NativeCommand { [string]$Command ) - $LookupNames = @($Command) - if ([System.IO.Path]::GetExtension($Command) -eq "") { - $LookupNames = @("$Command.cmd", "$Command.exe", "$Command.bat", $Command) + if ([System.IO.Path]::GetExtension($Command) -ne "") { + $FoundExact = Get-Command $Command -ErrorAction SilentlyContinue | Where-Object { $_.Source -and $_.Source -notmatch '\.ps1$' } | Select-Object -First 1 + if ($FoundExact) { + return $FoundExact.Source + } + + return $Command + } + + $Extensions = @(".cmd", ".exe", ".bat", "") + foreach ($Directory in ($env:PATH -split [System.IO.Path]::PathSeparator)) { + if ([string]::IsNullOrWhiteSpace($Directory)) { + continue + } + + foreach ($Extension in $Extensions) { + $Candidate = Join-Path $Directory "$Command$Extension" + if (Test-Path -LiteralPath $Candidate -PathType Leaf) { + return $Candidate + } + } } - foreach ($Name in $LookupNames) { - $Found = Get-Command $Name -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1 + foreach ($Name in @("$Command.cmd", "$Command.exe", "$Command.bat", $Command)) { + $Found = Get-Command $Name -ErrorAction SilentlyContinue | Where-Object { $_.Source -and $_.Source -notmatch '\.ps1$' } | Select-Object -First 1 if ($Found) { return $Found.Source } diff --git a/dist/DiscordLyrics-release.zip b/dist/DiscordLyrics-release.zip index 62bc519..cfcd166 100644 Binary files a/dist/DiscordLyrics-release.zip and b/dist/DiscordLyrics-release.zip differ diff --git a/dist/SpotifyLyricsStatus.plugin.js b/dist/SpotifyLyricsStatus.plugin.js index 7f8db3b..88a0f21 100644 --- a/dist/SpotifyLyricsStatus.plugin.js +++ b/dist/SpotifyLyricsStatus.plugin.js @@ -2,7 +2,7 @@ * @name DiscordLyrics * @author mally * @description Sets your Discord custom status to the current synced lyric from Spotify, or a pause status when playback stops. - * @version 1.0.4 + * @version 1.0.5 * @source https://lrclib.net */ @@ -14,7 +14,7 @@ const { execFile, spawn } = require("child_process"); module.exports = class DiscordLyrics { constructor() { this.name = "DiscordLyrics"; - this.version = "1.0.4"; + this.version = "1.0.5"; this.repo = "MallyDev2/DiscordLyrics"; this.latestReleaseApi = `https://api.github.com/repos/${this.repo}/releases/latest`; this.interval = null; diff --git a/dist/vencord-spotifyLyricsStatus.zip b/dist/vencord-spotifyLyricsStatus.zip index 7fb6b67..ef71488 100644 Binary files a/dist/vencord-spotifyLyricsStatus.zip and b/dist/vencord-spotifyLyricsStatus.zip differ diff --git a/dist/vencord/spotifyLyricsStatus/index.ts b/dist/vencord/spotifyLyricsStatus/index.ts index e138737..3cbe9de 100644 --- a/dist/vencord/spotifyLyricsStatus/index.ts +++ b/dist/vencord/spotifyLyricsStatus/index.ts @@ -32,7 +32,7 @@ const DEFAULT_SETTINGS = { rpcShowAlbumArt: true } as const; -const RELEASE_VERSION = "1.0.4"; +const RELEASE_VERSION = "1.0.5"; const REPO = "MallyDev2/DiscordLyrics"; const LATEST_RELEASE_API = `https://api.github.com/repos/${REPO}/releases/latest`; const LAST_UPDATE_CHECK_KEY = "DiscordLyrics.lastUpdateCheck"; diff --git a/package-lock.json b/package-lock.json index fb4c409..5b4ab6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mallydev2/discordlyrics", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mallydev2/discordlyrics", - "version": "1.0.4", + "version": "1.0.5", "license": "GPL-3.0-or-later", "devDependencies": {} } diff --git a/package.json b/package.json index 99d6aa3..9637868 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mallydev2/discordlyrics", - "version": "1.0.4", + "version": "1.0.5", "description": "Spotify lyrics status for BetterDiscord and Vencord.", "private": false, "author": "MallyDev2", diff --git a/scripts/DiscordLyrics-Installer.ps1 b/scripts/DiscordLyrics-Installer.ps1 index 10cc804..589ccb9 100644 --- a/scripts/DiscordLyrics-Installer.ps1 +++ b/scripts/DiscordLyrics-Installer.ps1 @@ -111,13 +111,31 @@ function Resolve-NativeCommand { [string]$Command ) - $LookupNames = @($Command) - if ([System.IO.Path]::GetExtension($Command) -eq "") { - $LookupNames = @("$Command.cmd", "$Command.exe", "$Command.bat", $Command) + if ([System.IO.Path]::GetExtension($Command) -ne "") { + $FoundExact = Get-Command $Command -ErrorAction SilentlyContinue | Where-Object { $_.Source -and $_.Source -notmatch '\.ps1$' } | Select-Object -First 1 + if ($FoundExact) { + return $FoundExact.Source + } + + return $Command + } + + $Extensions = @(".cmd", ".exe", ".bat", "") + foreach ($Directory in ($env:PATH -split [System.IO.Path]::PathSeparator)) { + if ([string]::IsNullOrWhiteSpace($Directory)) { + continue + } + + foreach ($Extension in $Extensions) { + $Candidate = Join-Path $Directory "$Command$Extension" + if (Test-Path -LiteralPath $Candidate -PathType Leaf) { + return $Candidate + } + } } - foreach ($Name in $LookupNames) { - $Found = Get-Command $Name -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1 + foreach ($Name in @("$Command.cmd", "$Command.exe", "$Command.bat", $Command)) { + $Found = Get-Command $Name -ErrorAction SilentlyContinue | Where-Object { $_.Source -and $_.Source -notmatch '\.ps1$' } | Select-Object -First 1 if ($Found) { return $Found.Source } diff --git a/vencord-userplugin/spotifyLyricsStatus/index.ts b/vencord-userplugin/spotifyLyricsStatus/index.ts index e138737..3cbe9de 100644 --- a/vencord-userplugin/spotifyLyricsStatus/index.ts +++ b/vencord-userplugin/spotifyLyricsStatus/index.ts @@ -32,7 +32,7 @@ const DEFAULT_SETTINGS = { rpcShowAlbumArt: true } as const; -const RELEASE_VERSION = "1.0.4"; +const RELEASE_VERSION = "1.0.5"; const REPO = "MallyDev2/DiscordLyrics"; const LATEST_RELEASE_API = `https://api.github.com/repos/${REPO}/releases/latest`; const LAST_UPDATE_CHECK_KEY = "DiscordLyrics.lastUpdateCheck";