Skip to content

Commit

Permalink
fix: improvements to download process of deno (#414)
Browse files Browse the repository at this point in the history
* chore: add note about deno version

* chore: more logging
  • Loading branch information
danez committed Jun 7, 2023
1 parent fe29861 commit 8e1ecec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion node/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { getLogger, Logger } from './logger.js'
import { getBinaryExtension } from './platform.js'

const DENO_VERSION_FILE = 'version.txt'
// When updating DENO_VERSION_RANGE, ensure that the deno version installed in the
// build-image/buildbot does satisfy this range!
const DENO_VERSION_RANGE = '^1.30.0'

type OnBeforeDownloadHook = () => void | Promise<void>
Expand Down Expand Up @@ -104,7 +106,9 @@ class DenoBridge {
}

return version[1]
} catch {}
} catch (error) {
this.logger.system('getBinaryVersion failed', error)
}
}

private async getCachedBinary() {
Expand Down
2 changes: 1 addition & 1 deletion node/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const download = async (targetDirectory: string, versionRange: string) => {

try {
await new Promise((resolve, reject) => {
data.pipe(file)
data.on('error', reject)
file.on('finish', resolve)
data.pipe(file)
})

await extractBinaryFromZip(zipPath, binaryPath, binaryName)
Expand Down

0 comments on commit 8e1ecec

Please sign in to comment.