output data on stdout
Summary: listening on `SIGINT` events and putting the serialized store to stdout. Reviewed By: passy Differential Revision: D13878051 fbshipit-source-id: 19c1d857a299ed9a474605169c54e5359e0515bd
This commit is contained in:
committed by
Facebook Github Bot
parent
45d1a7b35c
commit
3b75fb092b
@@ -13,6 +13,7 @@ import path from 'path';
|
||||
// $FlowFixMe this file exist, trust me, flow!
|
||||
import setup from '../static/setup.js';
|
||||
import yargs from 'yargs';
|
||||
import {serializeStore} from '../src/utils/exportData.js';
|
||||
|
||||
yargs
|
||||
.usage('$0 [args]')
|
||||
@@ -96,4 +97,11 @@ function startFlipper({
|
||||
const logger = new Logger(store);
|
||||
init(store);
|
||||
dispatcher(store, logger);
|
||||
|
||||
process.on('SIGINT', () => {
|
||||
originalConsole.log(
|
||||
JSON.stringify(serializeStore(store.getState()), null, 2),
|
||||
);
|
||||
process.exit();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user