Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow platform from manifest to overwrite platform #168

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/timodule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.