Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { execSync } = require('child_process');
- const fs = require('fs');
- const d = process.cwd();
- let pkgInfo = require(d + '/package.json');
- let ver = pkgInfo.version;
- ver = ver.split('.');
- let minor = ver.pop()*1 + 1;
- ver.push(minor);
- let nextVersion = ver.join('.') + '-SNAPSHOT';
- pkgInfo.version = nextVersion;
- fs.writeFileSync(d + '/package.json', JSON.stringify(pkgInfo, null, 2));
- execSync('git commit package.json -m "Prepare for next development iteration"');
- execSync('git push origin');
Add Comment
Please, Sign In to add comment