Guest User

Untitled

a guest
Mar 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. const { execSync } = require('child_process');
  2. const fs = require('fs');
  3.  
  4. const d = process.cwd();
  5. let pkgInfo = require(d + '/package.json');
  6.  
  7. let ver = pkgInfo.version;
  8.  
  9. ver = ver.split('.');
  10. let minor = ver.pop()*1 + 1;
  11. ver.push(minor);
  12.  
  13. let nextVersion = ver.join('.') + '-SNAPSHOT';
  14.  
  15. pkgInfo.version = nextVersion;
  16. fs.writeFileSync(d + '/package.json', JSON.stringify(pkgInfo, null, 2));
  17.  
  18. execSync('git commit package.json -m "Prepare for next development iteration"');
  19. execSync('git push origin');
Add Comment
Please, Sign In to add comment