Files
openzeppelin-contracts/scripts/release/synchronize-versions.js
Nicolás Venturo 571fa7f4e7 Fix linter error
2019-07-27 20:35:00 -03:00

19 lines
544 B
JavaScript
Executable File

#!/usr/bin/env node
// Synchronizes the versions in ethpm.json and contracts/package.json with the
// one in package.json.
// This is run automatically when npm version is run.
const fs = require('fs');
const cp = require('child_process');
setVersion('contracts/package.json');
setVersion('ethpm.json');
function setVersion (file) {
const json = JSON.parse(fs.readFileSync(file));
json.version = process.env.npm_package_version;
fs.writeFileSync(file, JSON.stringify(json, null, 2) + '\n');
cp.execFileSync('git', ['add', file]);
}