Address Sonar warnings and harden runtime
All checks were successful
build-and-push / lint (push) Successful in 4s
build-and-push / sonar (push) Successful in 12s
build-and-push / docker (push) Successful in 1m13s

This commit is contained in:
nocci 2025-12-30 14:54:14 +00:00
parent 9e2bc89ff2
commit 69282c63d5
5 changed files with 25 additions and 9 deletions

View file

@ -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')) {

View file

@ -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) {