Skip to content

Commit

Permalink
fix(js): check if asset create/update event contains a file before co…
Browse files Browse the repository at this point in the history
…pying (#12551)
  • Loading branch information
jaysoo committed Oct 12, 2022
1 parent 225ac9c commit 136e1a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/js/src/utils/assets/copy-assets-handler.ts
Expand Up @@ -36,7 +36,9 @@ export const defaultFileEventHandler = (events: FileEvent[]) => {
dirs.forEach((d) => fse.ensureDirSync(d));
events.forEach((event) => {
if (event.type === 'create' || event.type === 'update') {
fse.copyFileSync(event.src, event.dest);
if (fse.lstatSync(event.src).isFile()) {
fse.copyFileSync(event.src, event.dest);
}
} else if (event.type === 'delete') {
fse.removeSync(event.dest);
} else {
Expand Down

0 comments on commit 136e1a8

Please sign in to comment.