forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflow.js
More file actions
48 lines (42 loc) · 968 Bytes
/
flow.js
File metadata and controls
48 lines (42 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
var path = require('path');
var spawn = require('child_process').spawn;
var extension = process.platform === 'win32' ? '.cmd' : '';
module.exports = function(gulp, plugins) {
var gutil = plugins.util;
return function(done) {
spawn(
process.execPath,
[
path.join('node_modules', '.bin', 'flow' + extension),
'check',
'.',
],
{
// Allow colors to pass through
stdio: 'inherit',
}
).on('close', function(code) {
if (code !== 0) {
gutil.log(
gutil.colors.red(
'Flow failed'
)
);
process.exit(code);
}
gutil.log(
gutil.colors.green(
'Flow passed'
)
);
done();
});
};
};