Skip to content

Commit

Permalink
Merge pull request #30 from UNopenGIS:dev
Browse files Browse the repository at this point in the history
Temporary fix: file copying and fetching logic
  • Loading branch information
albertkun authored Dec 15, 2023
2 parents 26a5d24 + 02ecace commit 240050f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .scripts/copy-html-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const path = require('path');

// Define the source and destination directories
const sourceDir = path.join(__dirname, '..', 'docs');
const destDir = path.join(__dirname, '..', 'static');
const destDir1 = path.join(__dirname, '..', 'static');
const destDir2 = path.join(__dirname, '..', 'static/examples');

// Find all .html files in the source directory
glob(`${sourceDir}/**/*.html`, (err, files) => {
Expand All @@ -15,13 +16,18 @@ glob(`${sourceDir}/**/*.html`, (err, files) => {

console.log('Found files:', files);

// Copy each file to the destination directory
// Copy each file to the destination directories
files.forEach(file => {
const relativePath = path.relative(sourceDir, file);
const destFile = path.join(destDir, relativePath);
const destFile1 = path.join(destDir1, relativePath);
const destFile2 = path.join(destDir2, relativePath);

fs.copy(file, destFile)
.then(() => console.log(`Copied ${file} to ${destFile}`))
fs.copy(file, destFile1)
.then(() => console.log(`Copied ${file} to ${destFile1}`))
.catch(err => console.error(err));

fs.copy(file, destFile2)
.then(() => console.log(`Copied ${file} to ${destFile2}`))
.catch(err => console.error(err));
});
});

0 comments on commit 240050f

Please sign in to comment.