mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
Update message when file to copy already exists
This commit is contained in:
parent
c9f3f6a7dd
commit
6dd70c67f6
1 changed files with 7 additions and 2 deletions
|
@ -25,7 +25,9 @@ files.forEach(file => {
|
|||
if (file.includes("-examples")) {
|
||||
target = path.join(CWD, "..");
|
||||
}
|
||||
let fileName = file.substring(file.indexOf(examplesFolder) + examplesFolder.length);
|
||||
let fileName = file.substring(
|
||||
file.indexOf(examplesFolder) + examplesFolder.length
|
||||
);
|
||||
try {
|
||||
fs.copySync(file, path.join(target, fileName), {
|
||||
overwrite: false,
|
||||
|
@ -34,7 +36,10 @@ files.forEach(file => {
|
|||
console.log(fileName + " created in " + path.basename(target));
|
||||
} catch (e) {
|
||||
console.log(
|
||||
fileName + " already exists in " + path.basename(target)
|
||||
fileName +
|
||||
" already exists in " +
|
||||
path.basename(target) +
|
||||
". Remove or rename the file to regenerate this example file."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue