Add stub support for interactive mode

This commit is contained in:
Tim Schaub
2018-11-09 15:06:27 -07:00
parent 800776b6cb
commit 6f238a8d09

View File

@@ -262,8 +262,10 @@ async function main(entries, options) {
try { try {
await render(entries, options); await render(entries, options);
} finally { } finally {
if (!options.interactive) {
done(); done();
} }
}
} }
if (require.main === module) { if (require.main === module) {
@@ -292,6 +294,11 @@ if (require.main === module) {
type: 'boolean', type: 'boolean',
default: false default: false
}). }).
option('interactive', {
describe: 'Run all tests and keep the test server running (this option will be reworked later)',
type: 'boolean',
default: false
}).
option('log-level', { option('log-level', {
describe: 'The level for logging', describe: 'The level for logging',
choices: ['trace', 'debug', 'info', 'warn', 'error', 'silent'], choices: ['trace', 'debug', 'info', 'warn', 'error', 'silent'],
@@ -306,6 +313,9 @@ if (require.main === module) {
const entries = Object.keys(config.entry).map(key => config.entry[key]); const entries = Object.keys(config.entry).map(key => config.entry[key]);
if (options.interactive) {
options.force = true;
}
options.log = log.create({name: 'rendering', level: options.logLevel}); options.log = log.create({name: 'rendering', level: options.logLevel});
main(entries, options).catch(err => { main(entries, options).catch(err => {