add version script to update ethpm.json (#906)

This commit is contained in:
Francisco Giordano
2018-04-25 20:32:09 -03:00
committed by GitHub
parent 76fe1548ae
commit 90413e75f1
2 changed files with 18 additions and 1 deletions

16
scripts/version.js Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env node
// Synchronizes ethpm.json version number with package.json.
// Useful to run as an npm script alogn with `npm version`.
const fs = require('fs');
const cp = require('child_process');
const pkg = require('../package.json');
const ethpm = require('../ethpm.json');
ethpm.version = pkg.version;
fs.writeFileSync('ethpm.json', JSON.stringify(ethpm, null, 2) + '\n');
cp.execSync('git add ethpm.json');