Skip to content

Commit

Permalink
Improved documentation build/deploy script.
Browse files Browse the repository at this point in the history
  • Loading branch information
boltex committed Sep 7, 2024
1 parent 0852a78 commit ebaaa74
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions web/copy-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@ const path = require('path');
const sourceDir = path.join(__dirname, 'build');
const targetDir = path.join(__dirname, '..', 'docs');

// Copy the directory
fs.copy(sourceDir, targetDir, function (err) {
// Empty the target directory first
fs.emptyDir(targetDir, function (err) {
if (err) {
console.error('Error copying files:', err);
console.error('Error clearing the target directory:', err);
return;
}
console.log('Build directory copied successfully!');
});
console.log('Target directory cleared.');

// Copy the directory
fs.copy(sourceDir, targetDir, function (err) {
if (err) {
console.error('Error copying files:', err);
return;
}
console.log('Build directory copied successfully!');
});
});

0 comments on commit ebaaa74

Please sign in to comment.