From 6aae4bac0fc16decf904115b5308f7981c43fca7 Mon Sep 17 00:00:00 2001 From: Andrew McClenaghan Date: Fri, 16 Feb 2024 22:37:19 +1000 Subject: [PATCH] fix(cli): ensure cwd and outputDir are used for finding files (#1949) --- cli/src/api/universalize.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/api/universalize.ts b/cli/src/api/universalize.ts index 51f14300..f21dca56 100644 --- a/cli/src/api/universalize.ts +++ b/cli/src/api/universalize.ts @@ -43,7 +43,7 @@ export async function universalizeBinaries(userOptions: UniversalizeOptions) { } const srcFiles = UniArchsByPlatform[process.platform]?.map( - (arch) => `${config.binaryName}.${process.platform}-${arch}.node`, + (arch) => resolve(options.cwd, options.outputDir, `${config.binaryName}.${process.platform}-${arch}.node`), ) if (!srcFiles || !universalizers[process.platform]) { @@ -56,7 +56,7 @@ export async function universalizeBinaries(userOptions: UniversalizeOptions) { debug(' %O', srcFiles) const srcFileLookup = await Promise.all( - srcFiles.map((f) => fileExists(resolve(options.cwd, options.outputDir, f))), + srcFiles.map((f) => fileExists(f)), ) const notFoundFiles = srcFiles.filter((_, i) => !srcFileLookup[i])