Skip to content

Commit

Permalink
Merge branch 'release' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyklee committed Oct 24, 2019
2 parents 1f69115 + d5c838d commit 0681602
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/updatePackageVersion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const fs = require('fs');
const newVersionNumber = process.env.newversion;

function checkVersionGiven(){
if(newVersionNumber === undefined){
console.log('🔥🔥🔥submit the new version number 🔥🔥🔥');
process.exit(22);
}
}

function updatePackageVersion(fpath){
checkVersionGiven();
let packageJson = fs.readFileSync(fpath);
packageJson = JSON.parse(packageJson);
packageJson.version = newVersionNumber;


fs.writeFileSync(fpath, JSON.stringify(packageJson, null, 2));

}
updatePackageVersion('./package.json')

// module.exports = updatePackageVersion;

0 comments on commit 0681602

Please sign in to comment.