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 152c38e commit 57d91b1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/restore/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function restore(options, fileName, log, adapter, callback) {
try {
fs.unlinkSync(fileNameMysql);
} catch (e) {
log.debug(fileNameMysql + ' cannot deleted ...');
log.debug(`${fileNameMysql} cannot deleted ...`);
}
}
if (callback) {
Expand Down
4 changes: 2 additions & 2 deletions lib/scripts/30-mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ async function startBackup(options, log, callback) {

const child_process = require('node:child_process');

child_process.exec(`${options.exe ? options.exe : 'mysqldump'} -u ${options.user} -p${options.pass} ${options.dbName} -h ${options.host} -P ${options.port}${options.mysqlQuick ? ' --quick' : ''}${options.mysqlSingleTransaction ? ' --single-transaction' : ''} > ${fileNameMysql}`, {maxBuffer: 10 * 1024 * 1024}, async (error, stdout, stderr) => {
child_process.exec(`${options.exe ? options.exe : 'mysqldump'} -u ${options.user} -p${options.pass} ${options.dbName} -h ${options.host} -P ${options.port}${options.mysqlQuick ? ' --quick' : ''}${options.mysqlSingleTransaction ? ' --single-transaction' : ''} > ${fileNameMysql}`, { maxBuffer: 10 * 1024 * 1024 }, async (error, stdout, stderr) => {
if (error) {
let errLog = '' + error;
let errLog = `${error}`;
try {
const formatPass = options.pass.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errLog = errLog.replace(new RegExp(formatPass, 'g'), "****");
Expand Down
4 changes: 2 additions & 2 deletions lib/scripts/30-pgsql.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ async function startBackup(options, log, callback) {

const child_process = require('node:child_process');

child_process.exec(`${options.exe ? options.exe : 'pg_dump'} --dbname=postgresql://${options.user}:${options.pass}@${options.host}:${options.port}/${options.dbName} > ${fileNamePgsql}`, {maxBuffer: 10 * 1024 * 1024}, async (error, stdout, stderr) => {
child_process.exec(`${options.exe ? options.exe : 'pg_dump'} --dbname=postgresql://${options.user}:${options.pass}@${options.host}:${options.port}/${options.dbName} > ${fileNamePgsql}`, { maxBuffer: 10 * 1024 * 1024 }, async (error, stdout, stderr) => {
if (error) {
let errLog = '' + error;
let errLog = `${error}`;
try {
const formatPass = options.pass.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
errLog = errLog.replace(new RegExp(formatPass, 'g'), "****");
Expand Down
4 changes: 2 additions & 2 deletions lib/scripts/38-jarvis.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ async function command(options, log, callback) {
}
} else {
log.debug(`Backup created: ${fileName}`)
options.context.done.push('jarvis.' + file);
options.context.types.push('jarvis.' + file);
options.context.done.push(`jarvis.${file}`);
options.context.types.push(`jarvis.${file}`);
if (callback && num === files.length) {
callback(null, stdout);
callback = null;
Expand Down

0 comments on commit 57d91b1

Please sign in to comment.