mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
18 lines
419 B
JavaScript
18 lines
419 B
JavaScript
const semver = require('semver');
|
|
|
|
const latestUnleashVersion = process.argv[2];
|
|
|
|
const version = require('../package.json').version;
|
|
|
|
function isPrerelease(version) {
|
|
const arr = semver.prerelease(version);
|
|
return arr && arr.length > 0;
|
|
}
|
|
|
|
if(isPrerelease(version)){
|
|
console.log('beta')
|
|
}else if(semver.gt(version, latestUnleashVersion)) {
|
|
console.log('latest');
|
|
} else {
|
|
console.log('previous');
|
|
} |