refactor: read installed version using the package.json

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

View File

@ -9,7 +9,7 @@ export async function isNpx() {
}
export async function installedVersion() {
return (/musescore-downloader@([\d\.]+)/).exec((await exec('npm list -g musescore-downloader')).stdout)![1].trim()
return require('../package.json').version
}
export async function latestVersion() {
@ -18,4 +18,4 @@ export async function latestVersion() {
export async function isLatest() {
return await installedVersion() === await latestVersion()
}
}