From e79d2a7a7eeff321a7535e522c775ef271267a0f Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Tue, 24 Jun 2025 03:40:44 +0200 Subject: [PATCH] Add output to executeCommand return --- util/executeCommand.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/executeCommand.js b/util/executeCommand.js index ee4cce6..05985c5 100644 --- a/util/executeCommand.js +++ b/util/executeCommand.js @@ -2,13 +2,14 @@ const { execFileSync } = require('child_process'); module.exports = function(command, commandArgs, verbose=false) { if (typeof command !== 'string' || !Array.isArray(commandArgs)) return { error: true }; console.log("Executing:", command, commandArgs.join(" ")); + let output; try { - const output = execFileSync(command, commandArgs, {encoding: 'utf8'}) + output = execFileSync(command, commandArgs, {encoding: 'utf8'}) if (output.length !== 0 && verbose) console.log(output) } catch (error) { console.error(`Error executing ${command} command:`, error); return { error: true }; } - return { error: false }; + return { error: false, output}; } \ No newline at end of file