fix(cli): ensure cwd and outputDir are used for finding files (#1949)

This commit is contained in:
Andrew McClenaghan 2024-02-16 22:37:19 +10:00 committed by GitHub
parent 5ac153388f
commit 6aae4bac0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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])