Skip to content

Commit 75ea6ea

Browse files
committed
Fixing a bug where logs could break JSON output
1 parent 7db0fcb commit 75ea6ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bin/encore.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@
1313
const parseRuntime = require('../lib/config/parse-runtime');
1414
const context = require('../lib/context');
1515
const chalk = require('chalk');
16+
const logger = require('../lib/logger');
1617

1718
const runtimeConfig = parseRuntime(
1819
require('yargs/yargs')(process.argv.slice(2)).argv,
1920
process.cwd()
2021
);
2122
context.runtimeConfig = runtimeConfig;
2223

24+
// prevent logs from being dumped
25+
if (runtimeConfig.outputJson) {
26+
logger.quiet();
27+
}
28+
2329
// remove the command from the input
2430
process.argv.splice(2, 1);
2531

0 commit comments

Comments
 (0)