Skip to content

Commit

Permalink
chore: Updated bump script to commit CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodeah committed Mar 14, 2021
1 parent 036099c commit a8468b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions scripts/bump.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { execSync } = require('child_process');
const git = require("simple-git");
const simpleGit = require("simple-git");
const git = simpleGit();

const validArgs = ["major", "minor", "patch"];
const args = process.argv.slice(2);
Expand All @@ -13,16 +14,18 @@ if (args.length > 0) {
}

function bump(version) {
git().status().then((status) => {
git.status().then((status) => {
if (status.files.length === 0) {
execSync(`npm version ${version}`); // Bumps the version in package.json
execSync(`npx changelog`); // Generate the changelog
execSync("npm run build"); // Rebuild the project to update the version in the header of quicli.min.js

git.add(["CHANGELOG.md"]).commit("Updated CHANGELOG.md");

// You might not want to commit/push/publish straight away, so provide the commands to do it.
console.log("You might want to run these commands:");
console.log(` > git add . && git commit -m 'Bumped ${version} version'`);
console.log(" > git push origin master && npm publish");
console.log(" > git push origin master && git push --tags");
console.log(" > npm publish");
} else {
console.log("Commit your changes first!");
}
Expand Down

0 comments on commit a8468b3

Please sign in to comment.