Skip to content

Commit 66a5695

Browse files
committed
feat(prepare-commit-msg-hook): enhance commit message formatting with a divider and instructions for better user guidance
1 parent fd22f71 commit 66a5695

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/commands/prepare-commit-msg-hook.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ export const prepareCommitMessageHook = async (
5656

5757
const fileContent = await fs.readFile(messageFilePath);
5858

59+
const divider = '# ---------- [OpenCommit] ---------- #';
60+
5961
await fs.writeFile(
6062
messageFilePath,
61-
commitMessage + '\n' + fileContent.toString()
63+
`# ${commitMessage}\n\n${divider}\n# Remove the # above to use this generated commit message.\n# To cancel the commit, just close this window without making any changes.\n\n${fileContent.toString()}`
6264
);
6365
} catch (error) {
6466
outro(`${chalk.red('✖')} ${error}`);

0 commit comments

Comments
 (0)