From 66a5695d897ab5ae4e06abb246cd2cab9da007bf Mon Sep 17 00:00:00 2001 From: Phantas Weng Date: Tue, 1 Jul 2025 06:02:32 +0000 Subject: [PATCH] feat(prepare-commit-msg-hook): enhance commit message formatting with a divider and instructions for better user guidance --- src/commands/prepare-commit-msg-hook.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/prepare-commit-msg-hook.ts b/src/commands/prepare-commit-msg-hook.ts index 676757c..36e3f6d 100644 --- a/src/commands/prepare-commit-msg-hook.ts +++ b/src/commands/prepare-commit-msg-hook.ts @@ -56,9 +56,11 @@ export const prepareCommitMessageHook = async ( const fileContent = await fs.readFile(messageFilePath); + const divider = '# ---------- [OpenCommit] ---------- #'; + await fs.writeFile( messageFilePath, - commitMessage + '\n' + fileContent.toString() + `# ${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()}` ); } catch (error) { outro(`${chalk.red('✖')} ${error}`);