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.
This commit is contained in:
JoelEinbinder 2017-12-28 17:19:13 -08:00 committed by Andrey Lushnikov
parent 05f4f943f0
commit bd73e4b7b8
3 changed files with 15 additions and 1 deletions

View File

@ -27,6 +27,7 @@ jobs:
env: NODE7=true
- node_js: "6.4.0"
env: NODE6=true
before_deploy: "yarn run apply-next-version"
deploy:
provider: npm
email: aslushnikov@gmail.com

View File

@ -20,7 +20,8 @@
"build": "node utils/node6-transform/index.js",
"unit-node6": "node node6/test/test.js",
"tsc": "tsc -p .",
"prepublishOnly": "npm run build"
"prepublishOnly": "npm run build",
"apply-next-version": "node utils/apply_next_version.js"
},
"author": "The Chromium Authors",
"license": "Apache-2.0",

View File

@ -0,0 +1,12 @@
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');