Skip to content

Commit

Permalink
(simatec) Code fix
Browse files Browse the repository at this point in the history
  • Loading branch information
simatec committed Dec 3, 2024
1 parent 57d91b1 commit f8a7815
Show file tree
Hide file tree
Showing 9 changed files with 229 additions and 229 deletions.
48 changes: 24 additions & 24 deletions lib/scripts/96-discord.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@ function command(options, log, callback) {

errorMessage += '\n';

if (options.context.errors.iobroker) errorMessage += '\niobroker: ' + options.context.errors.iobroker;
if (options.context.errors.redis) errorMessage += '\nredis: ' + options.context.errors.redis;
if (options.context.errors.historyDB) errorMessage += '\nhistoryDB: ' + options.context.errors.historyDB;
if (options.context.errors.influxDB) errorMessage += '\ninfluxDB: ' + options.context.errors.influxDB;
if (options.context.errors.sqlite) errorMessage += '\nsqlite: ' + options.context.errors.sqlite;
if (options.context.errors.nodered) errorMessage += '\nnodered: ' + options.context.errors.nodered;
if (options.context.errors.yahka) errorMessage += '\nyahka: ' + options.context.errors.yahka;
if (options.context.errors.zigbee) errorMessage += '\nzigbee: ' + options.context.errors.zigbee;
if (options.context.errors.zigbee2mqtt) errorMessage += '\nzigbee2mqtt: ' + options.context.errors.zigbee2mqtt;
if (options.context.errors.javascripts) errorMessage += '\njavascripts: ' + options.context.errors.javascripts;
if (options.context.errors.jarvis) errorMessage += '\njarvis: ' + options.context.errors.jarvis;
if (options.context.errors.clean) errorMessage += '\nclean: ' + options.context.errors.clean;
if (options.context.errors.iobroker) errorMessage += `\niobroker: ${options.context.errors.iobroker}`;
if (options.context.errors.redis) errorMessage += `\nredis: ${options.context.errors.redis}`;
if (options.context.errors.historyDB) errorMessage += `\nhistoryDB: ${options.context.errors.historyDB}`;
if (options.context.errors.influxDB) errorMessage += `\ninfluxDB: ${options.context.errors.influxDB}`;
if (options.context.errors.sqlite) errorMessage += `\nsqlite: ${options.context.errors.sqlite}`;
if (options.context.errors.nodered) errorMessage += `\nnodered: ${options.context.errors.nodered}`;
if (options.context.errors.yahka) errorMessage += `\nyahka: ${options.context.errors.yahka}`;
if (options.context.errors.zigbee) errorMessage += `\nzigbee: ${options.context.errors.zigbee}`;
if (options.context.errors.zigbee2mqtt) errorMessage += `\nzigbee2mqtt: ${options.context.errors.zigbee2mqtt}`;
if (options.context.errors.javascripts) errorMessage += `\njavascripts: ${options.context.errors.javascripts}`;
if (options.context.errors.jarvis) errorMessage += `\njarvis: ${options.context.errors.jarvis}`;
if (options.context.errors.clean) errorMessage += `\nclean: ${options.context.errors.clean}`;

if (options.context.errors.mount) {
errorMessage += '\nmount: ' + options.context.errors.mount;
errorMessage += `\nmount: ${options.context.errors.mount}`;
try {
const formatPass = options.cifs.pass.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.cifs && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand All @@ -94,7 +94,7 @@ function command(options, log, callback) {
}
}
if (options.context.errors.mysql) {
errorMessage += '\nmysql: ' + options.context.errors.mysql;
errorMessage += `\nmysql: ${options.context.errors.mysql}`;
try {
const formatPass = options.mysql.pass.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.mysql && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand All @@ -103,7 +103,7 @@ function command(options, log, callback) {
}
}
if (options.context.errors.grafana) {
errorMessage += '\ngrafana: ' + options.context.errors.grafana;
errorMessage += `\ngrafana: ${options.context.errors.grafana}`;
try {
const formatPass = options.grafana.pass.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.grafana && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand All @@ -116,7 +116,7 @@ function command(options, log, callback) {
}

if (options.context.errors.webdav) {
errorMessage += '\nwebdav: ' + options.context.errors.webdav;
errorMessage += `\nwebdav: ${options.context.errors.webdav}`;
try {
const formatPass = options.webdav.pass.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.webdav && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand All @@ -125,7 +125,7 @@ function command(options, log, callback) {
}
}
if (options.context.errors.pgsql) {
errorMessage += '\npgsql: ' + options.context.errors.pgsql;
errorMessage += `\npgsql: ${options.context.errors.pgsql}`;
try {
const formatPass = options.pgsql.pass.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.pgsql && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand All @@ -134,7 +134,7 @@ function command(options, log, callback) {
}
}
if (options.context.errors.ccu) {
errorMessage += '\nccu: ' + options.context.errors.ccu;
errorMessage += `\nccu: ${options.context.errors.ccu}`;
try {
const formatPass = options.ccu.pass.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.ccu && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand All @@ -143,7 +143,7 @@ function command(options, log, callback) {
}
}
if (options.context.errors.ftp) {
errorMessage += '\nftp: ' + options.context.errors.ftp;
errorMessage += `\nftp: ${options.context.errors.ftp}`;
try {
const formatPass = options.ftp.pass.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.ftp && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand All @@ -152,7 +152,7 @@ function command(options, log, callback) {
}
}
if (options.context.errors.dropbox) {
errorMessage += '\ndropbox: ' + options.context.errors.dropbox;
errorMessage += `\ndropbox: ${options.context.errors.dropbox}`;
try {
const formatPass = options.dropbox.accessToken.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.dropbox && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand All @@ -161,7 +161,7 @@ function command(options, log, callback) {
}
}
if (options.context.errors.onedrive) {
errorMessage += '\nonedrive: ' + options.context.errors.onedrive;
errorMessage += `\nonedrive: ${options.context.errors.onedrive}`;
try {
const formatPass = options.onedrive.onedriveAccessJson.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.onedrive && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand All @@ -170,7 +170,7 @@ function command(options, log, callback) {
}
}
if (options.context.errors.googledrive) {
errorMessage += '\ngoogledrive: ' + options.context.errors.googledrive;
errorMessage += `\ngoogledrive: ${options.context.errors.googledrive}`;
try {
const formatPass = options.googledrive.accessJson.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.googledrive && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand All @@ -180,7 +180,7 @@ function command(options, log, callback) {

}
if (options.context.errors.cifs) {
errorMessage += '\ncifs: ' + options.context.errors.cifs;
errorMessage += `\ncifs: ${options.context.errors.cifs}`;
try {
const formatPass = options.cifs.pass.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.cifs && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand All @@ -189,7 +189,7 @@ function command(options, log, callback) {
}
}
if (options.context.errors.umount) {
errorMessage += '\numount: ' + options.context.errors.umount;
errorMessage += `\numount: ${options.context.errors.umount}`;
try {
const formatPass = options.cifs.pass.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errorMessage = (options.cifs && formatPass ? errorMessage.replace(new RegExp(formatPass, 'g'), "****") : errorMessage);
Expand Down
Loading

0 comments on commit f8a7815

Please sign in to comment.