Skip to content

Commit

Permalink
fix: await lifecycle hooks as they might return promises (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Jun 23, 2022
1 parent 0d5a2b0 commit 01b53c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DenoBridge {
}

private async downloadBinary() {
this.onBeforeDownload?.()
await this.onBeforeDownload?.()

await fs.mkdir(this.cacheDirectory, { recursive: true })

Expand All @@ -68,14 +68,14 @@ class DenoBridge {
'There was a problem setting up the Edge Functions environment. To try a manual installation, visit https://ntl.fyi/install-deno.',
)

this.onAfterDownload?.(error)
await this.onAfterDownload?.(error)

throw error
}

await this.writeVersionFile(downloadedVersion)

this.onAfterDownload?.()
await this.onAfterDownload?.()

return binaryPath
}
Expand Down

0 comments on commit 01b53c6

Please sign in to comment.