Skip to content

Commit

Permalink
Add logging level for RNPM previous linking
Browse files Browse the repository at this point in the history
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:**
![screen shot 2016-08-21 at 11 49 07 am](https://cloud.githubusercontent.com/assets/997157/17838588/84223264-6796-11e6-81d2-075d30942a69.png)

**Into this:**
![screen shot 2016-08-21 at 11 52 31 am](https://cloud.githubusercontent.com/assets/997157/17838592/92c2ce64-6796-11e6-884d-e5af8f4c2b5a.png)

Which is a pretty nice experience!   This also helps you quickly identify when 1 thing wasn't linked, at a glance, like so!
![image](https://cloud.githubusercontent.com/assets/997157/17838613/22568c8c-6797-11e6-8e12-c73746ec0eff.png)
Closes #9507

Differential Revision: D3757516

fbshipit-source-id: e4c691824e9318d36f4c1d89673b7e747fb972f1
  • Loading branch information
GantMan authored and Facebook Github Bot committed Aug 23, 2016
1 parent e63a7ea commit 85a2d6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions local-cli/link/link.js
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 85a2d6a

Please sign in to comment.