eg: exit like others if headless and no login data given

This commit is contained in:
Ralf Vogler 2023-02-22 00:16:19 +01:00
parent 66694d65e5
commit b0f662479d

View file

@ -89,6 +89,11 @@ try {
} else { } else {
console.log('Waiting for you to login in the browser.'); console.log('Waiting for you to login in the browser.');
notify('epic-games: no longer signed in and not enough options set for automatic login.'); notify('epic-games: no longer signed in and not enough options set for automatic login.');
if (cfg.headless) {
console.log('Run `SHOW=1 node epic-games` to login in the opened browser.');
await context.close(); // finishes potential recording
process.exit(1);
}
} }
await page.waitForURL(URL_CLAIM); await page.waitForURL(URL_CLAIM);
if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout);