👷 ci(build): add SonarQube scan to build workflow
- introduce SonarQube scanning step for code quality analysis - update workflow dependencies and execution order 🐛 fix(auth): improve error handling and code formatting - remove unused imports and fix code indentation - enhance error handling with improved catch blocks 💄 style(general): standardize code formatting and style consistency - update various files to ensure consistent code style - adjust indentation and whitespace for readability
This commit is contained in:
parent
0e5303da62
commit
d40a577f47
7 changed files with 95 additions and 62 deletions
|
|
@ -96,21 +96,21 @@ const timeoutPlugin = timeout => enquirer => { // cancel prompt after timeout ms
|
|||
prompt.hint = () => 'timeout';
|
||||
prompt.cancel();
|
||||
}, timeout);
|
||||
prompt.on('submit', _ => clearTimeout(t));
|
||||
prompt.on('cancel', _ => clearTimeout(t));
|
||||
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 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 });
|
||||
|
||||
// notifications via apprise CLI
|
||||
import { execFile } from 'child_process';
|
||||
import { cfg } from './config.js';
|
||||
|
||||
export const notify = html => new Promise((resolve, reject) => {
|
||||
export const notify = html => new Promise(resolve => {
|
||||
if (!cfg.notify) {
|
||||
if (cfg.debug) console.debug('notify: NOTIFY is not set!');
|
||||
return resolve();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue