refactor: check for latest version

This commit is contained in:
Xmader 2021-01-20 10:44:00 -05:00 committed by GitHub
parent 030d37ddc0
commit bd943675d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -186,7 +186,11 @@ void (async () => {
)
spinner.succeed('OK')
if (!(await isNpx()) && !(await isLatest())) {
console.log(chalk.yellowBright(`Your installed version (${await installedVersion()}) of the musescore-downloader CLI is not the latest one (${await latestVersion()})!\nRun npm i -g musescore-downloader to update.`))
if (!(await isNpx())) {
const installed = await installedVersion()
const latest = await latestVersion()
if (!isLatest(installed, latest)) {
console.log(chalk.yellowBright(`Your installed version (${installed}) of the musescore-downloader CLI is not the latest one (${latest})!\nRun npm i -g musescore-downloader to update.`))
}
}
})()