fix eslint errors

This commit is contained in:
Ralf Vogler 2023-11-07 18:10:22 +01:00
parent 6a34cb541d
commit e4e4f2eafa
5 changed files with 14 additions and 13 deletions

View file

@ -74,11 +74,12 @@ const timeoutPlugin = timeout => enquirer => { // cancel prompt after timeout ms
prompt.on('submit', _ => clearTimeout(t));
prompt.on('cancel', _ => clearTimeout(t));
});
}
};
enquirer.use(timeoutPlugin(cfg.login_timeout)); // TODO may not want to have this timeout for all prompts; better extend Prompt and add a timeout prompt option
// single prompt that just returns the non-empty value instead of an object
// @ts-ignore
export const prompt = o => enquirer.prompt({name: 'name', type: 'input', message: 'Enter value', ...o}).then(r => r.name).catch(_ => {});
export const confirm = o => prompt({type: 'confirm', message: 'Continue?', ...o})
export const confirm = o => prompt({type: 'confirm', message: 'Continue?', ...o});
// notifications via apprise CLI
import { exec } from 'child_process';
@ -93,7 +94,7 @@ export const notify = (html) => new Promise((resolve, reject) => {
if (error.message.includes('command not found')) {
console.info('Run `pip install apprise`. See https://github.com/vogler/free-games-claimer#notifications');
}
return resolve();
return reject(error);
}
if (stderr) console.error(`stderr: ${stderr}`);
if (stdout) console.log(`stdout: ${stdout}`);