0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

chore: changeset (#10925)

This commit is contained in:
Erika 2024-05-01 14:03:55 +02:00 committed by GitHub
parent dd1d937621
commit a0c77fc716
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"@astrojs/db": patch
---
Fixes `ASTRO_DATABASE_FILE` not correctly resolving relative paths (e.g. `ASTRO_DATABASE_FILE=./api/database.db`

View file

@ -139,7 +139,8 @@ export function normalizeDatabaseUrl(envDbUrl: string | undefined, defaultDbUrl:
if (envDbUrl.startsWith('file://')) {
return envDbUrl;
}
return new URL(envDbUrl, pathToFileURL(process.cwd())).toString();
return new URL(envDbUrl, pathToFileURL(process.cwd()) + "/").toString();
} else {
// This is going to be a file URL always,
return defaultDbUrl;