Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions maploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ function copyFiles(source, destination) {
}

for (i = 0; i < files.length; i++) {
fs.copyFileSync(source + files[i], destination + files[i]);
console.log('Copied ' + files[i] + ' from ' + source + ' to ' + destination);
if (fs.existsSync(destination + files[i])){//deletes existing file in destinations to ensure only files from chosen map set are present in destination
fs.unlinkSync(destination + files[i]);
console.log('Deleted ' + files[i] + ' from ' + destination);
}
if (fs.existsSync(source + files[i])){//checks before copying to prevent errors causing remaining files to fail
fs.copyFileSync(source + files[i], destination + files[i]);
console.log('Copied ' + files[i] + ' from ' + source + ' to ' + destination);
}
}
}