diff --git a/src/commands/prepare-commit-msg-hook.ts b/src/commands/prepare-commit-msg-hook.ts index a8f3c71..f5caef6 100644 --- a/src/commands/prepare-commit-msg-hook.ts +++ b/src/commands/prepare-commit-msg-hook.ts @@ -37,8 +37,12 @@ export const prepareCommitMessageHook = async () => { if (typeof commitMessage !== 'string') throw new Error(commitMessage.error); - // TODO: change to read file > write file with commitMessage - await fs.appendFile(messageFilePath, commitMessage); + const fileContent = await fs.readFile(messageFilePath); + + await fs.writeFile( + messageFilePath, + commitMessage + '\n' + fileContent.toString() + ); outro(`${chalk.green('✔')} commit done`); } catch (error) {