Skip to content

Commit

Permalink
Update version-checker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
phyzical authored Aug 3, 2024
1 parent 3cbe190 commit a67d602
Showing 1 changed file with 13 additions and 13 deletions.
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 a67d602

Please sign in to comment.