summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/db/src/core/integration/file-url.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/db/src/core/integration/file-url.ts b/packages/db/src/core/integration/file-url.ts
index 06bc67de1..72e49004e 100644
--- a/packages/db/src/core/integration/file-url.ts
+++ b/packages/db/src/core/integration/file-url.ts
@@ -72,12 +72,12 @@ export function fileURLIntegration(): AstroIntegration {
unlinks.push(fs.promises.unlink(url));
}
await Promise.all(unlinks);
+ // Delete the assets directory if it is empty.
+ // NOTE(fks): Ignore errors here because this is expected to fail
+ // if the directory contains files, or if it does not exist.
+ // If it errors for some unknown reason, it's not a big deal.
const assetDir = new URL(config.build.assets, config.outDir);
- const assetFiles = await fs.promises.readdir(assetDir);
- if (!assetFiles.length) {
- // Directory is empty, delete it.
- await fs.promises.rmdir(assetDir);
- }
+ await fs.promises.rmdir(assetDir).catch(() => []);
} else {
// Move files back over to the dist output path
const moves: Promise<unknown>[] = [];