Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions SpotifyLyricsStatus.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand All @@ -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;
Expand Down
Binary file modified dist/DiscordLyrics-Installer.exe
Binary file not shown.
28 changes: 23 additions & 5 deletions dist/DiscordLyrics-Installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Binary file modified dist/DiscordLyrics-release.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions dist/SpotifyLyricsStatus.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand All @@ -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;
Expand Down
Binary file modified dist/vencord-spotifyLyricsStatus.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/vencord/spotifyLyricsStatus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
28 changes: 23 additions & 5 deletions scripts/DiscordLyrics-Installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion vencord-userplugin/spotifyLyricsStatus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading