Skip to content

Commit

Permalink
Fix Tests on Linux/MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanLobbenmeier committed Sep 8, 2022
1 parent 701a265 commit be1c412
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/BinaryUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class BinaryUpdater {
this.paths = paths;
this.win = win;
this.action = "Installing";
this.platform = process.platform;
}

//Checks for an update and download it if there is.
Expand Down Expand Up @@ -60,7 +61,7 @@ class BinaryUpdater {

async getRemoteVersion() {
const releaseUrl = "https://github.com/yt-dlp/yt-dlp/releases/latest/"
const binaryUrl = process.platform === "win32" ? "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe" : "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp"
const binaryUrl = this.platform === "win32" ? "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe" : "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp"
try {
await axios.get(releaseUrl, {
responseType: 'document',
Expand Down
1 change: 1 addition & 0 deletions tests/BinaryUpdater.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ describe('getRemoteVersion', () => {
}
});
const instance = new BinaryUpdater({platform: "win32"});
instance.platform = "win32";
return instance.getRemoteVersion().then((data) => {
expect(data).toEqual({
remoteUrl: binaryUrl,
Expand Down

0 comments on commit be1c412

Please sign in to comment.