From c4ab56a5356c4d1c3bdcfaa2eba9aa6d5a7ee998 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 15 Sep 2020 15:19:39 -0400 Subject: [PATCH] Fix --- commands/util/exec.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/commands/util/exec.js b/commands/util/exec.js index 17cabea6..eccd3d3b 100644 --- a/commands/util/exec.js +++ b/commands/util/exec.js @@ -33,8 +33,11 @@ module.exports = class ExecCommand extends Command { } exec(command) { - const { stdout, stderr } = execSync(command); - if (stderr) return { err: true, std: stderr.trim() }; - return { err: false, std: stdout.trim() }; + try { + const stdout = execSync(command, { timeout: 30000 }); + return { err: false, std: stdout.trim() }; + } catch (err) { + return { err: true, std: err.stderr.trim() }; + } } };