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

Fixing bugs in link and unlink #18207

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions local-cli/link/ios/common/isInstalled.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const isInstalledIOS = require('../isInstalled');
const isInstalledPods = require('../../pods/isInstalled');

module.exports = function isInstalled(config, name) {
return isInstalledIOS(config, name) || isInstalledPods(config, name);
module.exports = function isInstalled(projectConfig, name, dependencyConfig) {
return isInstalledIOS(projectConfig, dependencyConfig) || isInstalledPods(projectConfig, dependencyConfig);
};
4 changes: 2 additions & 2 deletions local-cli/link/ios/common/unregisterNativeModule.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const compact = require('lodash').compact;
const isInstalledIOS = require('../isInstalled');
const isInstalledPods = require('../../pods/isInstalled');
const unregisterDependencyIOS = require('../registerNativeModule');
const unregisterDependencyPods = require('../../pods/registerNativeModule');
const unregisterDependencyIOS = require('../unregisterNativeModule');
const unregisterDependencyPods = require('../../pods/unregisterNativeModule');

module.exports = function unregisterNativeModule(
name,
Expand Down
2 changes: 1 addition & 1 deletion local-cli/link/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const linkDependency = (platforms, project, dependency) => {
return null;
}

const isInstalled = linkConfig.isInstalled(project[platform], dependency.config[platform]);
const isInstalled = linkConfig.isInstalled(project[platform], dependency.name, dependency.config[platform]);

if (isInstalled) {
log.info(chalk.grey(`Platform '${platform}' module ${dependency.name} is already linked`));
Expand Down
2 changes: 1 addition & 1 deletion local-cli/link/unlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const unlinkDependency = (platforms, project, dependency, packageName, otherDepe
return;
}

const isInstalled = linkConfig.isInstalled(project[platform], dependency[platform]);
const isInstalled = linkConfig.isInstalled(project[platform], packageName, dependency[platform]);

if (!isInstalled) {
log.info(`Platform '${platform}' module ${packageName} is not installed`);
Expand Down