mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 05:15:49 +08:00
[ReactNative] Dim packager output
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
var chalk = require('chalk');
|
||||
var exec = require('child_process').exec;
|
||||
var Activity = require('./react-packager/src/Activity');
|
||||
|
||||
var hasWarned = {};
|
||||
|
||||
@@ -44,20 +45,10 @@ function getFlowTypeCheckMiddleware(options) {
|
||||
|
||||
function doFlowTypecheck(res, flowroot, next) {
|
||||
var flowCmd = 'cd "' + flowroot + '" && flow --json --timeout 20';
|
||||
var start = Date.now();
|
||||
// Log start message if flow is slow to let user know something is happening.
|
||||
var flowSlow = setTimeout(
|
||||
function() {
|
||||
console.log(chalk.gray('flow: Running static typechecks.'));
|
||||
},
|
||||
500
|
||||
);
|
||||
var eventId = Activity.startEvent('flow static typechecks');
|
||||
exec(flowCmd, function(flowError, stdout, stderr) {
|
||||
clearTimeout(flowSlow);
|
||||
Activity.endEvent(eventId);
|
||||
if (!flowError) {
|
||||
console.log(chalk.gray(
|
||||
'flow: Typechecks passed (' + (Date.now() - start) + 'ms).')
|
||||
);
|
||||
return next();
|
||||
} else {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user