11import os from "node:os"
22
33import { Octokit } from "@octokit/rest"
4- import { createWriteStream } from "node:fs" ;
5- import { pipeline } from "node:stream/promises" ;
4+ import { createWriteStream } from "node:fs"
5+ import { pipeline } from "node:stream/promises"
66import { getProxyForUrl } from "proxy-from-env"
77import { fetch , ProxyAgent } from "undici"
88import type { RequestInit } from "undici"
@@ -25,7 +25,11 @@ export async function findRelease(version: string) {
2525 if ( ! matchedAsset ) {
2626 throw new Error ( `The binary '${ releasePrefix } *' not found` )
2727 }
28- return [ release . data . name , matchedAsset . id , matchedAsset . name . endsWith ( ".zip" ) ? "zip" : "tar" ] as const
28+ return [
29+ release . data . name ,
30+ matchedAsset . id ,
31+ matchedAsset . name . endsWith ( ".zip" ) ? "zip" : "tar" ,
32+ ] as const
2933}
3034
3135export async function downloadBinary ( asset_id : number , asset_filetype : string ) {
@@ -35,17 +39,17 @@ export async function downloadBinary(asset_id: number, asset_filetype: string) {
3539 repo : NAME ,
3640 asset_id : asset_id ,
3741 headers : {
38- accept : "application/octet-stream"
42+ accept : "application/octet-stream" ,
3943 } ,
4044 request : {
4145 parseSuccessResponseBody : false , // required to access response as stream
42- }
43- } ) ;
46+ } ,
47+ } )
4448 const tmpfile = await tmp . file ( )
4549
46- const assetStream = asset . data as unknown as NodeJS . ReadableStream ;
47- const outputFile = createWriteStream ( tmpfile . path ) ;
48- await pipeline ( assetStream , outputFile ) ;
50+ const assetStream = asset . data as unknown as NodeJS . ReadableStream
51+ const outputFile = createWriteStream ( tmpfile . path )
52+ await pipeline ( assetStream , outputFile )
4953
5054 if ( asset_filetype === ".zip" ) {
5155 const zip = new admzip ( tmpfile . path )
0 commit comments