include gitignore

This commit is contained in:
Leon van Zyl
2025-11-06 08:00:36 +02:00
parent 7549b73a6c
commit 7f92051064
5 changed files with 66 additions and 3 deletions

View File

@@ -100,6 +100,15 @@ async function main() {
await fs.copy(envExamplePath, envPath);
}
// Rename _gitignore to .gitignore (npm excludes .gitignore by default)
const gitignoreTemplatePath = path.join(targetDir, '_gitignore');
const gitignorePath = path.join(targetDir, '.gitignore');
if (fs.existsSync(gitignoreTemplatePath)) {
spinner.text = 'Setting up .gitignore file...';
await fs.move(gitignoreTemplatePath, gitignorePath, { overwrite: true });
}
// Update package.json name if not current directory
if (projectDir !== '.') {
const packageJsonPath = path.join(targetDir, 'package.json');