1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/scripts/npm-tag.js
2022-04-20 23:38:55 +02:00

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