It even starts to remove a file before it finish it. (#6472)

* dont finish the action of the copy before removing all files.

* change name
This commit is contained in:
wulinsheng123 2023-03-16 01:53:10 +08:00 committed by GitHub
parent 22955b895c
commit bf024cb342
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
don't finish the action of the copy before removing all files.

View file

@ -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;
}