mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
Ensure .gitignore file gets copied by examples script
This commit is contained in:
parent
43d2eb14c2
commit
06254ae021
1 changed files with 15 additions and 0 deletions
|
@ -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 => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue