Skip to content

Commit

Permalink
fix(packages/create-astro): wait for writeFile to complete in updateF…
Browse files Browse the repository at this point in the history
…iles (#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>
  • Loading branch information
3 people authored Mar 19, 2024
1 parent 7eac778 commit 2330f22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/light-falcons-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-astro": patch
---

Fixes a case where a promise wasn't awaited, causing an issue in Deno.
2 changes: 1 addition & 1 deletion packages/create-astro/src/actions/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })),
Expand Down

0 comments on commit 2330f22

Please sign in to comment.