Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
process.env.WORKSPACE = process.env.WORKSPACE || '.';
const p = require(process.env.WORKSPACE + '/package.json');
const n = new Date();
const d = new Date(+n - (n.getTimezoneOffset() * 60000));
const v = p.version.split('-')[0] + '-dev.' + d.toISOString().slice(0, 10);
console.log(p.version, '->', v);
p.version = v;
const exec = require('child_process').execSync;
const fs = require('fs');
fs.writeFileSync('./package.json', JSON.stringify(p, null, 2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.