mirror of
https://github.com/web-infra-dev/midscene.git
synced 2025-12-26 06:28:56 +00:00
fix(cli): keep window after cli running (#598)
This commit is contained in:
parent
df77c335fe
commit
10efa40c8b
@ -8,6 +8,7 @@ module.exports = {
|
||||
[
|
||||
// Allowed scopes
|
||||
'core',
|
||||
'cli',
|
||||
'workflow',
|
||||
'android',
|
||||
'llm',
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user