skip prompt for password if email is missing

This commit is contained in:
Ralf Vogler 2023-02-09 16:28:27 +01:00
parent 65a389c3d9
commit dff712d998
3 changed files with 3 additions and 3 deletions

View file

@ -72,7 +72,7 @@ try {
if (cfg.eg_email && cfg.eg_password) console.info('Using email and password from environment.');
else console.info('Press ESC to skip if you want to login in the browser.');
const email = cfg.eg_email || await prompt({message: 'Enter email'});
const password = cfg.eg_password || await prompt({type: 'password', message: 'Enter password'});
const password = email && (cfg.eg_password || await prompt({type: 'password', message: 'Enter password'}));
if (email && password) {
await page.click('text=Sign in with Epic Games');
await page.fill('#email', email);