Skip to content

Commit

Permalink
add version script to update ethpm.json (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Apr 25, 2018
1 parent 76fe154 commit 90413e7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -11,7 +11,8 @@
"lint:all": "npm run lint && npm run lint:sol",
"lint:all:fix": "npm run lint:fix && npm run lint:sol:fix",
"console": "truffle console",
"coverage": "scripts/coverage.sh"
"coverage": "scripts/coverage.sh",
"version": "scripts/version.js"
},
"repository": {
"type": "git",
Expand Down
16 changes: 16 additions & 0 deletions scripts/version.js
@@ -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');

0 comments on commit 90413e7

Please sign in to comment.