mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-29 07:48:17 +08:00
Add logging level for RNPM previous linking
Summary: Sometimes when working with a team of developers, someone adds a library but does not link it. To identify if this required linking, you have to type `react-native link` and then read a wall of text to see if rnpm handled the issue. This can be sped up with a friendly logging level for previously linked messages. **This PR turns this:**  **Into this:**  Which is a pretty nice experience! This also helps you quickly identify when 1 thing wasn't linked, at a glance, like so!  Closes https://github.com/facebook/react-native/pull/9507 Differential Revision: D3757516 fbshipit-source-id: e4c691824e9318d36f4c1d89673b7e747fb972f1
This commit is contained in:
committed by
Facebook Github Bot
parent
e63a7ea7bd
commit
85a2d6a65d
@@ -2,6 +2,7 @@ const log = require('npmlog');
|
||||
const path = require('path');
|
||||
const uniq = require('lodash').uniq;
|
||||
const flatten = require('lodash').flatten;
|
||||
const chalk = require('chalk');
|
||||
|
||||
const isEmpty = require('lodash').isEmpty;
|
||||
const promiseWaterfall = require('./promiseWaterfall');
|
||||
@@ -32,7 +33,7 @@ const linkDependencyAndroid = (androidProject, dependency) => {
|
||||
const isInstalled = isInstalledAndroid(androidProject, dependency.name);
|
||||
|
||||
if (isInstalled) {
|
||||
log.info(`Android module ${dependency.name} is already linked`);
|
||||
log.info(chalk.grey(`Android module ${dependency.name} is already linked`));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -58,7 +59,7 @@ const linkDependencyIOS = (iOSProject, dependency) => {
|
||||
const isInstalled = isInstalledIOS(iOSProject, dependency.config.ios);
|
||||
|
||||
if (isInstalled) {
|
||||
log.info(`iOS module ${dependency.name} is already linked`);
|
||||
log.info(chalk.grey(`iOS module ${dependency.name} is already linked`));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user