From 3dd8e43133c433d756a8844ebfd5040d697f8d1f Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Mon, 20 Sep 2021 07:14:15 -0500 Subject: [PATCH] fix: use setupCppDir inside setupLLVM --- src/llvm/llvm.ts | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/llvm/llvm.ts b/src/llvm/llvm.ts index e7983a59..95a4bbd4 100644 --- a/src/llvm/llvm.ts +++ b/src/llvm/llvm.ts @@ -230,26 +230,17 @@ async function getLLVMPackageInfo(version: string, platform: NodeJS.Platform): P } } -const DEFAULT_NIX_DIRECTORY = "./llvm" -const DEFAULT_WIN32_DIRECTORY = "C:/Program Files/LLVM" +// const DEFAULT_UNIX_DIRECTORY = "./llvm" +// const DEFAULT_WIN32_DIRECTORY = "C:/Program Files/LLVM" export async function setupLLVM( version: string, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - _setupCppDir: string | undefined, + setupCppDir: string, // eslint-disable-next-line @typescript-eslint/no-unused-vars _arch: string ): Promise { - let directory = _setupCppDir - if (directory === "" || directory === undefined) { - directory = process.platform === "win32" ? DEFAULT_WIN32_DIRECTORY : DEFAULT_NIX_DIRECTORY - } - - directory = path.resolve(directory) - - const installationInfo = await setupBin("llvm", version, getLLVMPackageInfo, directory) - - await activateLLVM(directory, version) + const installationInfo = await setupBin("llvm", version, getLLVMPackageInfo, setupCppDir) + await activateLLVM(setupCppDir, version) return installationInfo }