fix: .gitignore missing trailing newline during project initialization (#855)

This commit is contained in:
Joe Danziger
2025-06-24 00:42:23 -04:00
committed by GitHub
parent 295087a5b8
commit e4456b11bc
3 changed files with 13 additions and 5 deletions

View File

@@ -170,7 +170,7 @@ function validateInputs(targetPath, content, storeTasksInGit) {
*/
function createNewGitignoreFile(targetPath, templateLines, log) {
try {
fs.writeFileSync(targetPath, templateLines.join('\n'));
fs.writeFileSync(targetPath, templateLines.join('\n') + '\n');
if (typeof log === 'function') {
log('success', `Created ${targetPath} with full template`);
}
@@ -223,7 +223,7 @@ function mergeWithExistingFile(
finalLines.push(...buildTaskFilesSection(storeTasksInGit));
// Write result
fs.writeFileSync(targetPath, finalLines.join('\n'));
fs.writeFileSync(targetPath, finalLines.join('\n') + '\n');
if (typeof log === 'function') {
const hasNewContent =