fix(cli): keep window after cli running (#598)

This commit is contained in:
yuyutaotao 2025-04-21 13:54:58 +08:00 committed by GitHub
parent df77c335fe
commit 10efa40c8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View File

@ -8,6 +8,7 @@ module.exports = {
[
// Allowed scopes
'core',
'cli',
'workflow',
'android',
'llm',

View File

@ -35,14 +35,23 @@ Promise.resolve(
process.exit(1);
}
const keepWindow = options['keep-window'] || false;
const success = await playYamlFiles(files, {
headed: !!options.headed,
keepWindow: !!options['keep-window'],
keepWindow,
});
if (!success) {
process.exit(1);
if (keepWindow) {
// hang the process to keep the browser window open
setInterval(() => {
console.log('browser is still running, use ctrl+c to stop it');
}, 5000);
} else {
if (!success) {
process.exit(1);
}
process.exit(0);
}
process.exit(0);
})().catch((e) => {
console.error(e);
process.exit(1);