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)

(cherry picked from commit 136e1a8)
  • Loading branch information
jaysoo authored and FrozenPandaz committed Oct 13, 2022
1 parent 9ce268b commit 64103af
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
Original file line number Diff line number Diff line change
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 64103af

Please sign in to comment.