mirror of
https://github.com/status-im/react-native.git
synced 2025-02-12 17:36:27 +00:00
Improve unlink
on rnpm
Summary: We don't need to look for `thisDependency` as we already have it. Small improvement as I am working on other fixes. Closes https://github.com/facebook/react-native/pull/11867 Differential Revision: D4411177 fbshipit-source-id: 1413eb5457cb4d7916ead90f438ffe158f644cad
This commit is contained in:
parent
6b1bc4ad74
commit
4969f26252
@ -113,19 +113,20 @@ function unlink(args, config) {
|
||||
|
||||
const allDependencies = getDependencyConfig(config, getProjectDependencies());
|
||||
const otherDependencies = filter(allDependencies, d => d.name !== packageName);
|
||||
const thisDependency = find(allDependencies, d => d.name === packageName);
|
||||
const iOSDependencies = compact(otherDependencies.map(d => d.config.ios));
|
||||
|
||||
const tasks = [
|
||||
() => promisify(thisDependency.config.commands.preunlink || commandStub),
|
||||
() => promisify(dependency.commands.preunlink || commandStub),
|
||||
() => unlinkDependencyAndroid(project.android, dependency, packageName),
|
||||
() => unlinkDependencyIOS(project.ios, dependency, packageName, iOSDependencies),
|
||||
() => unlinkDependencyWindows(project.windows, dependency, packageName),
|
||||
() => promisify(thisDependency.config.commands.postunlink || commandStub)
|
||||
() => promisify(dependency.commands.postunlink || commandStub)
|
||||
];
|
||||
|
||||
return promiseWaterfall(tasks)
|
||||
.then(() => {
|
||||
// @todo move all these to `tasks` array, just like in
|
||||
// link
|
||||
const assets = difference(
|
||||
dependency.assets,
|
||||
flatten(allDependencies, d => d.assets)
|
||||
|
Loading…
x
Reference in New Issue
Block a user