1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/scripts/npm-tag.js

18 lines
419 B
JavaScript
Raw Normal View History

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');
}