From 7d008179dfb94c8686c55c6d0418f58994393779 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Wed, 6 Jul 2016 17:53:20 +0100 Subject: [PATCH] Fix the archiver using the old API binary filename This caused the DLLs included in the v0.9.0 and v0.9.1 releases to actually be a DLL built at some point between v0.8.1 and v0.9.0... --- scripts/helpers.js | 40 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/scripts/helpers.js b/scripts/helpers.js index 45dcba71..c565db0c 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -72,41 +72,21 @@ function getApiBinaryPaths(rootPath) { }, ]; + let file = 'loot_api'; + if (os.platform() === 'win32') { + file += '.dll'; + } else { + file += '.so'; + } + for (let i = 0; i < pathsToTry.length; ++i) { - let files = []; if (os.platform() === 'win32') { pathsToTry[i].path = path.join(pathsToTry[i].path, 'Release'); - - files = [ - { - name: 'loot32.dll', - label: '32 bit', - }, - { - name: 'loot64.dll', - label: '64 bit', - }, - ]; - } else { - files = [ - { - name: 'libloot32.so', - label: '32 bit', - }, - { - name: 'libloot64.so', - label: '64 bit', - }, - ]; } - for (let j = 0; j < files.length; ++j) { - if (fileExists(path.join(pathsToTry[i].path, files[j].name))) { - pathsToTry[i].path = path.join(pathsToTry[i].path, files[j].name); - pathsToTry[i].label = files[j].label; - paths.push(pathsToTry[i]); - break; - } + if (fileExists(path.join(pathsToTry[i].path, file))) { + pathsToTry[i].path = path.join(pathsToTry[i].path, file); + paths.push(pathsToTry[i]); } }