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:
Daniel Büchele
2019-02-04 07:21:56 -08:00
committed by Facebook Github Bot
parent 45d1a7b35c
commit 3b75fb092b
3 changed files with 25 additions and 13 deletions

View File

@@ -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();
});
}