Ensure .gitignore file gets copied by examples script

This commit is contained in:
Frank Li 2017-08-10 16:33:38 -07:00
parent 43d2eb14c2
commit 06254ae021

View file

@ -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 => {