Address Sonar warnings and harden runtime
This commit is contained in:
parent
9e2bc89ff2
commit
69282c63d5
5 changed files with 25 additions and 9 deletions
|
|
@ -121,10 +121,11 @@ export const notify = html => new Promise(resolve => {
|
|||
if (cfg.debug) console.debug('notify: NOTIFY is not set!');
|
||||
return resolve();
|
||||
}
|
||||
const appriseBin = process.env.APPRISE_BIN || '/usr/local/bin/apprise';
|
||||
const args = [cfg.notify, '-i', 'html', '-b', `'${html}'`];
|
||||
if (cfg.notify_title) args.push('-t', cfg.notify_title);
|
||||
if (cfg.debug) console.debug(`apprise ${args.join(' ')}`); // this also doesn't escape, but it's just for info
|
||||
execFile('apprise', args, (error, stdout, stderr) => {
|
||||
if (cfg.debug) console.debug(`${appriseBin} ${args.join(' ')}`); // this also doesn't escape, but it's just for info
|
||||
execFile(appriseBin, args, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.log(`error: ${error.message}`);
|
||||
if (error.message.includes('command not found')) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue