Skip to content

Commit 7d3622e

Browse files
committed
[api] more fixes related to command line execution
1 parent e8a8cab commit 7d3622e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

plugins/crashes/api/api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ plugins.setConfigs("crashes", {
7272
ob.export_commands.crashes = [];
7373
}
7474
ob.export_commands.crashes.push({cmd: 'mongoexport', args: [...ob.dbargs, '--collection', 'app_crashes' + ob.app_id, '-q', '{uid:{$in: ["' + uids.join('","') + '"]}}', '--out', ob.export_folder + '/crashes' + ob.app_id + '.json']});
75-
ob.export_commands.crashes.push({cmd: 'mongoexport', args: [...ob.dbargs, '--collection', 'app_crashusers' + ob.app_id, '-q', '{uid:{$in: ["' + uids.join('","') + '"]}}\' --out ' + ob.export_folder + '/crashusers' + ob.app_id + '.json']});
75+
ob.export_commands.crashes.push({cmd: 'mongoexport', args: [...ob.dbargs, '--collection', 'app_crashusers' + ob.app_id, '-q', '{uid:{$in: ["' + uids.join('","') + '"]}}', '--out', ob.export_folder + '/crashusers' + ob.app_id + '.json']});
7676
resolve();
7777
}
7878
});

plugins/plugin-upload/frontend/app.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,16 @@ function validate_files(my_path) {
264264
/**Function used to call new child process, separated from parent. For validate_reset()
265265
* @param {string} my_command = command to call
266266
* @param {array} my_args - array with command arguments
267-
* @param {string} my_dir - folder
268267
* @param {string} logpath - path to log file
269268
* @returns {Promise} promise
270269
*/
271-
function run_command(my_command, my_args, my_dir, logpath) {
270+
function run_command(my_command, my_args, logpath) {
272271
return new Promise(function(resolve, reject) {
273272
var stdio = ['inherit', 'inherit', 'inherit'];
274273
if (logpath) {
275274
const out = fs.openSync(logpath, 'a');
276275
const err = fs.openSync(logpath, 'a');
277276
stdio = [ 'ignore', out, err ];
278-
279277
}
280278
var child = spawn(my_command, my_args, {cwd: __dirname, shell: false, detached: true, stdio: stdio}, function(error) {
281279
if (error) {
@@ -343,8 +341,7 @@ function validate_reset() {
343341
var logpath = path.resolve(__dirname, './../../../log/plugins-disable' + (new Date().toISOString().replace('T', ':')) + '.log');
344342

345343
var mydir = path.resolve(__dirname + '/../scripts');
346-
run_command('bash', [mydir + '/disable_plugins.sh', ...pluginlist],
347-
mydir, logpath)
344+
run_command('bash', [mydir + '/disable_plugins.sh', ...pluginlist], logpath)
348345
.then(
349346
function() {
350347
try {
@@ -429,7 +426,7 @@ function extract_files(ext, target_path) {
429426
if (ext === "tar") {
430427
args = ["xf", target_path, "-C", path.resolve(__dirname + '/upload/unpacked')];
431428
}
432-
run_command(command, args, null, null).then(function() {
429+
run_command(command, args, null).then(function() {
433430
resolve();
434431
},
435432
function() {

0 commit comments

Comments
 (0)