diff --git a/scripts/archive.js b/scripts/archive.js index 73bd7221..7f4bd0d2 100644 --- a/scripts/archive.js +++ b/scripts/archive.js @@ -168,15 +168,28 @@ function createAppArchive(rootPath, releasePath, tempPath, destPath) { fs.removeSync(tempPath); } -function createApiArchive(rootPath, binaryPath, tempPath, destPath) { +function createApiArchive(rootPath, releasePath, tempPath, destPath) { // Ensure that the output directory is empty. fs.emptyDirSync(tempPath); // API binary/binaries. - fs.copySync( - binaryPath, - path.join(tempPath, path.basename(binaryPath)) - ); + let binaries = []; + if (os.platform() === 'win32') { + binaries = [ + 'loot_api.dll', + 'loot_api.lib', + ]; + } else { + binaries = [ + 'libloot_api.so', + ]; + } + binaries.forEach((file) => { + fs.copySync( + path.join(releasePath, file), + path.join(tempPath, file) + ); + }); // API header file. fs.mkdirsSync(path.join(tempPath, 'include', 'loot')); diff --git a/scripts/helpers.js b/scripts/helpers.js index 2a1bda5c..88428277 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -73,7 +73,9 @@ function getApiBinaryPaths(rootPath) { file = `lib${file}.so`; } - return getBinaryPaths(rootPath, file); + return getBinaryParentPaths(rootPath).filter( + parentPath => fileExists(path.join(parentPath.path, file)) + ); } function getMetadataValidatorBinaryPaths(rootPath) {