Release v1.5.0 #8

Merged
CTO merged 4 commits from develop into main 2023-08-23 19:47:45 +00:00
Showing only changes of commit 92f8126abf - Show all commits

View File

@@ -51,8 +51,10 @@ program
.command("commit") .command("commit")
.description("Create a conventional commit") .description("Create a conventional commit")
.option("-S, --sign", "sign the commit") .option("-S, --sign", "sign the commit")
.option("--amend", "amend commit message to the last commit")
.action(async (options) => { .action(async (options) => {
const sign = options.sign ? true : false; const sign = options.sign ? true : false;
const amend = options.amend ? true : false;
const config = await GetConfig(); const config = await GetConfig();
@@ -63,10 +65,12 @@ program
process.exit(0); process.exit(0);
} }
const stageAll = await confirm({ const stageAll = amend
message: "Stage all changes?", ? null
initialValue: true, : await confirm({
}); message: "Stage all changes?",
initialValue: true,
});
if (isCancel(stageAll)) { if (isCancel(stageAll)) {
cancel("Commit creation cancelled"); cancel("Commit creation cancelled");
@@ -204,14 +208,24 @@ program
if (stageAll) { if (stageAll) {
await simpleGit() await simpleGit()
.add(".") .add(".")
.commit(commitMessage, sign ? ["-S"] : []); .commit(
commitMessage,
sign ? (amend ? ["-S", "--amend"] : ["-S"]) : amend ? ["--amend"] : []
);
} else { } else {
await simpleGit().commit(commitMessage, sign ? ["-S"] : []); await simpleGit().commit(
commitMessage,
sign ? (amend ? ["-S", "--amend"] : ["-S"]) : amend ? ["--amend"] : []
);
} }
note(commitMessage); note(commitMessage);
outro("Finished creating a conventional commit, feel free to push"); outro(
`Finished ${
amend ? "amending" : "creating"
} a conventional commit, feel free to push`
);
}); });
program program