From 0c992489bcfa8fd2f6f837edc2c5774025ea76b8 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Wed, 16 Nov 2022 11:51:39 -0500 Subject: [PATCH] Stop using source code in build file Signed-off-by: Sebastian Malton --- build/download_binaries.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build/download_binaries.ts b/build/download_binaries.ts index 61c38eae06..826c713fd3 100644 --- a/build/download_binaries.ts +++ b/build/download_binaries.ts @@ -15,8 +15,8 @@ import type { SingleBar } from "cli-progress"; import { MultiBar } from "cli-progress"; import { extract } from "tar-stream"; import gunzip from "gunzip-maybe"; -import { getBinaryName } from "../src/common/vars"; import { isErrnoException, setTimeoutFor } from "../src/common/utils"; +import AbortController from "abort-controller"; type Response = FetchModule.Response; type RequestInfo = FetchModule.RequestInfo; @@ -24,6 +24,14 @@ type RequestInit = FetchModule.RequestInit; const pipeline = promisify(_pipeline); +const getBinaryName = (binaryName: string, { forPlatform }: { forPlatform : string }) => { + if (forPlatform === "windows") { + return `${binaryName}.exe`; + } + + return binaryName; +}; + interface BinaryDownloaderArgs { readonly version: string; readonly platform: SupportedPlatform;