mirror of
https://github.com/withastro/astro.git
synced 2025-02-17 22:44:24 -05:00
fix(packages/create-astro): wait for writeFile to complete in updateFiles (#10487)
* fix(packages/create-astro): wait for writeFile to complete in updateFiles Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com> * changeset --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
This commit is contained in:
parent
7eac778cce
commit
2330f22d6c
2 changed files with 6 additions and 1 deletions
5
.changeset/light-falcons-battle.md
Normal file
5
.changeset/light-falcons-battle.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"create-astro": patch
|
||||
---
|
||||
|
||||
Fixes a case where a promise wasn't awaited, causing an issue in Deno.
|
|
@ -59,7 +59,7 @@ const FILES_TO_UPDATE = {
|
|||
fs.promises.readFile(file, 'utf-8').then((value) => {
|
||||
// Match first indent in the file or fallback to `\t`
|
||||
const indent = /(^\s+)/m.exec(value)?.[1] ?? '\t';
|
||||
fs.promises.writeFile(
|
||||
return fs.promises.writeFile(
|
||||
file,
|
||||
JSON.stringify(
|
||||
Object.assign(JSON.parse(value), Object.assign(overrides, { private: undefined })),
|
||||
|
|
Loading…
Add table
Reference in a new issue