From 3d4f7ec05c89fcb64bb34c7b1be49657c059c093 Mon Sep 17 00:00:00 2001 From: 3w36zj6 <52315048+3w36zj6@users.noreply.github.com> Date: Sat, 14 Sep 2024 00:56:03 +0900 Subject: [PATCH] Ensure `.gitignore` updated via CLI ends with a newline --- code/lib/create-storybook/src/initiate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/create-storybook/src/initiate.ts b/code/lib/create-storybook/src/initiate.ts index 787e16288cc2..bed1870fd2a9 100644 --- a/code/lib/create-storybook/src/initiate.ts +++ b/code/lib/create-storybook/src/initiate.ts @@ -375,7 +375,7 @@ export async function doInitiate(options: CommandOptions): Promise< if (foundGitIgnoreFile && foundGitIgnoreFile.includes(rootDirectory)) { const contents = await readFile(foundGitIgnoreFile, 'utf-8'); if (!contents.includes('*storybook.log')) { - await appendFile(foundGitIgnoreFile, '\n*storybook.log'); + await appendFile(foundGitIgnoreFile, '\n*storybook.log\n'); } }