Skip to content

Commit

Permalink
It even starts to remove a file before it finish it. (#6472)
Browse files Browse the repository at this point in the history
* dont finish the action of the copy before removing all files.

* change name
  • Loading branch information
JerryWu1234 authored Mar 15, 2023
1 parent 22955b8 commit bf024cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/forty-dodos-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

don't finish the action of the copy before removing all files.
2 changes: 1 addition & 1 deletion packages/astro/src/core/build/static-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ async function cleanServerOutput(opts: StaticBuildOptions) {
// Clean out directly if the outDir is outside of root
if (out.toString() !== opts.settings.config.outDir.toString()) {
// Copy assets before cleaning directory if outside root
copyFiles(out, opts.settings.config.outDir);
await copyFiles(out, opts.settings.config.outDir);
await fs.promises.rm(out, { recursive: true });
return;
}
Expand Down

0 comments on commit bf024cb

Please sign in to comment.