puppeteer/utils/apply_next_version.js
JoelEinbinder bd73e4b7b8 chore: use unique version for puppeteer@next (#1688)
This patch starts amending package.json with a unique puppeteer@next version
so that it gets published on npm.
2017-12-28 17:19:13 -08:00

12 lines
453 B
JavaScript

const path = require('path');
const fs = require('fs');
const package = require('../package.json');
let version = package.version;
const dashIndex = version.indexOf('-');
if (dashIndex !== -1)
version = version.substring(0, dashIndex);
version += '-next.' + Date.now();
console.log('Setting version to ' + version);
package.version = version;
fs.writeFileSync(path.join(__dirname, '..', 'package.json'), JSON.stringify(package, undefined, 2) + '\n');