Skip to content

Commit

Permalink
Merge pull request #257 from phyzical/master
Browse files Browse the repository at this point in the history
Fix version checker
  • Loading branch information
phyzical authored Aug 3, 2024
2 parents 3cbe190 + bd1c930 commit 9956d80
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@swapnilsoni1999/spotify-dl",
"productName": "Spotify Downloader",
"version": "1.2.1",
"version": "1.2.2",
"description": "Spotify Songs, Playlist & Album Downloader",
"main": "app.js",
"bin": {
Expand Down
26 changes: 13 additions & 13 deletions util/version-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ const checkVersion = async () => {
const res = await axios.default(
'https://api.github.com/repos/SwapnilSoni1999/spotify-dl/tags'
);
const latestVersion = res.data[0].name;
const pkg = meow('', { importMeta: import.meta }).pkg;

if (pkg.version !== latestVersion) {
console.log(
[
'\n========Update Available========',
'Use npm install -g spotify-dl',
'to update the package.',
'================================\n',
].join('\n')
);
}
} catch (_e) {
console.log("Could not check current version, have checked too many times skipping");
return;
}
const latestVersion = res.data[0].name;
const pkg = meow('', { importMeta: import.meta }).pkg;

if (pkg.version !== latestVersion) {
console.log(
[
'\n========Update Available========',
'Use npm install -g spotify-dl',
'to update the package.',
'================================\n',
].join('\n')
);
}
};

export default checkVersion;

0 comments on commit 9956d80

Please sign in to comment.