From b957bc4ab8a43e42facb84ff5e9dc895498dfb3b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 14 Sep 2021 04:27:55 -0500 Subject: [PATCH] fix: support downloading raw binaries --- src/utils/setup/setupBin.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/setup/setupBin.ts b/src/utils/setup/setupBin.ts index 98711c29..ae5b2e1e 100644 --- a/src/utils/setup/setupBin.ts +++ b/src/utils/setup/setupBin.ts @@ -7,14 +7,14 @@ import { tmpdir } from "os" /** A type that describes a package */ export type PackageInfo = { - /** url to download the package */ + /** Url to download the package */ url: string /** The top folder name once it is extracted. It can be `""` if there is no top folder */ extractedFolderName: string /** The relative directory in which the binary is located. It can be `""` if the exe is in the top folder */ binRelativeDir: string - /** the function to extract the downloaded archive */ - extractFunction: { + /** The function to extract the downloaded archive. It can be `undefined`, if the binary itself is downloaded directly. */ + extractFunction?: { (url: string, outputPath: string): Promise } } @@ -47,7 +47,7 @@ export async function setupBin( if (!existsSync(workDir)) { await group(`Download and extract ${name}`, async () => { const downloaded = await downloadTool(url) - await extractFunction(downloaded, workDir) + await extractFunction?.(downloaded, workDir) }) }