diff --git a/lib/timodule.js b/lib/timodule.js index 669ab833..204ee3b9 100644 --- a/lib/timodule.js +++ b/lib/timodule.js @@ -710,7 +710,7 @@ async function detectNativeModuleViaNPMPackage(singlePackageDir, logger) { * @returns {object} the detected module */ async function detectPlatformSpecificNativeModuleInNPMPackage(directory, platformName, platformCount, json, logger) { - const platform = platformAliases[platformName] || platformName; // normalize platform name for return data + let platform = platformAliases[platformName] || platformName; // normalize platform name for return data let modulePath = path.join(directory, platform); // try the normalized platform alias ('ios') first if (!await fs.exists(modulePath)) { // doesn't exist, so fall back to original platform name if it differed @@ -744,6 +744,7 @@ async function detectPlatformSpecificNativeModuleInNPMPackage(directory, platfor // TODO: Throw a sanity Error if value we *must* have are missing from manifest object! // TODO: Throw Errors is both manifest and package.json have values but they don't match? + platform = manifest.platform || platform; logger && logger.debug(__('Detected %s module: %s %s @ %s', platform, manifest.moduleid.cyan, json.version, modulePath)); return { id: manifest.moduleid, diff --git a/test/resources/native-module-with-manifest/node_modules/native-module-with-manifest/manifest b/test/resources/native-module-with-manifest/node_modules/native-module-with-manifest/manifest index c794d0bf..57e02eb2 100644 --- a/test/resources/native-module-with-manifest/node_modules/native-module-with-manifest/manifest +++ b/test/resources/native-module-with-manifest/node_modules/native-module-with-manifest/manifest @@ -10,5 +10,5 @@ copyright: Copyright (c) 2016-Present by Appcelerator, Inc. guid: bba89061-0fdb-4ff1-95a8-02876f5601f9 name: Native Module w/ Manifest moduleid: native-module-with-manifest -platform: iphone +platform: ios minsdk: 5.0.0