Dev version based on time

This commit is contained in:
Tim Schaub
2019-09-23 19:24:16 +02:00
parent 60378f2089
commit 5290486e23
2 changed files with 15 additions and 1 deletions

14
tasks/next-dev-version.js Normal file
View File

@@ -0,0 +1,14 @@
const version = require('../package.json').version;
const semver = require('semver');
function nextVersion() {
const s = semver.parse(version);
if (!s) {
throw new Error(`Invalid version ${version}`);
}
return `${s.major}.${s.minor}.${s.patch}-dev.${Date.now()}`;
}
if (require.main === module) {
process.stdout.write(`${nextVersion()}\n`);
}