Skip to content

Commit

Permalink
fix: copy
Browse files Browse the repository at this point in the history
  • Loading branch information
whes1015 committed Dec 3, 2024
1 parent f1c6432 commit a6926eb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/js/core/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -806,13 +806,17 @@ class PluginLoader {
await fs.ensureDir(targetPath);

const copyFiles = async (dir, baseTarget, baseSource) => {
const items = await fs.readdir(dir);
const items = await fs.readdir(dir, { withFileTypes: true });

for (const item of items) {
const sourceFull = path.join(dir, item);
if (item.name.startsWith('.')) {
continue;
}

const sourceFull = path.join(dir, item.name);
const targetFull = path.join(baseTarget, path.relative(baseSource, sourceFull));
const stat = await fs.stat(sourceFull);

if (stat.isDirectory()) {
if (item.isDirectory()) {
await fs.ensureDir(targetFull);
await copyFiles(sourceFull, baseTarget, baseSource);
}
Expand Down

0 comments on commit a6926eb

Please sign in to comment.