mirror of
https://github.com/facebook/lexical.git
synced 2025-08-06 16:39:33 +08:00
Add some Flow typs
Add some Flow types
This commit is contained in:

committed by
acywatson

parent
071356444b
commit
be0b1836f3
40
scripts/tasks/flow.js
Normal file
40
scripts/tasks/flow.js
Normal file
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const {spawn} = require('child_process');
|
||||
|
||||
async function runFlow(renderer, args) {
|
||||
return new Promise(resolve => {
|
||||
let cmd = __dirname + '/../../node_modules/.bin/flow';
|
||||
if (process.platform === 'win32') {
|
||||
cmd = cmd.replace(/\//g, '\\') + '.cmd';
|
||||
}
|
||||
|
||||
console.log(
|
||||
'Running Flow...',
|
||||
);
|
||||
|
||||
spawn(cmd, args, {
|
||||
// Allow colors to pass through:
|
||||
stdio: 'inherit',
|
||||
}).on('close', function(code) {
|
||||
if (code !== 0) {
|
||||
console.error(
|
||||
'Flow failed :(',
|
||||
);
|
||||
console.log();
|
||||
process.exit(code);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
runFlow();
|
Reference in New Issue
Block a user