feat(commands): add ability to write a footer

This commit is contained in:
2023-08-21 18:10:39 +03:00
parent 9311be80b2
commit 755da3bb57
2 changed files with 12 additions and 1 deletions

View File

@@ -4,6 +4,8 @@
"dictionaryDefinitions": [], "dictionaryDefinitions": [],
"dictionaries": [], "dictionaries": [],
"words": [ "words": [
"Acked",
"johndoe",
"outro", "outro",
"rczrc" "rczrc"
], ],

View File

@@ -145,6 +145,15 @@ program
process.exit(0); process.exit(0);
} }
const footer = await text({
message: `Insert commit footer, can be left empty, e.g. Acked-by: @johndoe`,
});
if (isCancel(footer)) {
cancel("Commit creation cancelled");
process.exit(0);
}
const isBreaking = await confirm({ const isBreaking = await confirm({
message: "Does this commit have breaking changes?", message: "Does this commit have breaking changes?",
initialValue: false, initialValue: false,
@@ -178,7 +187,7 @@ program
scope ? `(${scope.toString()})` : `` scope ? `(${scope.toString()})` : ``
}${isBreaking ? "!" : ""}: ${message.toString()}${ }${isBreaking ? "!" : ""}: ${message.toString()}${
resolvesIssue ? ` (${issue?.toString()})` : `` resolvesIssue ? ` (${issue?.toString()})` : ``
}${body ? `\n\n${body}` : ``}`; }${body ? `\n\n${body}` : ``}${footer ? `\n\n${footer}` : ``}`;
if (stageAll) { if (stageAll) {
await simpleGit() await simpleGit()