Skip to content

Instantly share code, notes, and snippets.

@jackyef
Last active February 5, 2020 16:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackyef/9049817da9c40d13873f0e9fbc9b04f8 to your computer and use it in GitHub Desktop.
Save jackyef/9049817da9c40d13873f0e9fbc9b04f8 to your computer and use it in GitHub Desktop.
// update package.json
fs.writeFileSync("./package.json", JSON.stringify({ version: String(newVersion) }, null, 2));
// create a new commit
child.execSync('git add .');
child.execSync(`git commit -m "chore: Bump to version ${newVersion}"`);
// tag the commit
child.execSync(`git tag -a -m "Tag for version ${newVersion}" version${newVersion}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment