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

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