Skip to content

Instantly share code, notes, and snippets.

@heycalmdown
Last active June 14, 2018 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save heycalmdown/01be82234785265302d8cc49c913bee8 to your computer and use it in GitHub Desktop.
Save heycalmdown/01be82234785265302d8cc49c913bee8 to your computer and use it in GitHub Desktop.
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