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')) {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
// check if running the latest version
|
||||
|
||||
import { log } from 'console';
|
||||
import { execFile } from 'child_process';
|
||||
import { execFile } from 'node:child_process';
|
||||
|
||||
const gitBin = process.env.GIT_BIN || '/usr/bin/git';
|
||||
|
||||
const runGit = (...args) => new Promise((resolve, reject) => {
|
||||
execFile('git', args, { cwd: process.cwd() }, (error, stdout, stderr) => {
|
||||
execFile(gitBin, args, { cwd: process.cwd() }, (error, stdout, stderr) => {
|
||||
if (stderr) console.error(`stderr: ${stderr}`);
|
||||
// if (stdout) console.log(`stdout: ${stdout}`);
|
||||
if (error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue