diff --git a/lib/copy-examples.js b/lib/copy-examples.js index 8ca2282815..792740f2ce 100755 --- a/lib/copy-examples.js +++ b/lib/copy-examples.js @@ -149,6 +149,21 @@ if (feature === "translations") { )} to see the example blog posts on your site.\n` ); } + // copy .gitignore file + if (fs.existsSync(CWD + "/.gitignore")) { + console.log( + `${chalk.yellow(".gitignore already exists")} in ${chalk.yellow( + "website/" + )}. Rename or remove the file to regenerate an example version.\n` + ); + } else { + fs.copySync(path.join(folder, ".gitignore"), path.join(CWD, ".gitignore")); + console.log( + `${chalk.green("Example .gitignore file created")} in ${chalk.yellow( + "website/" + )}.\n` + ); + } // copy other files let files = glob.sync(folder + "/**/*"); files.forEach(file => {