From cc3f62dfbf6f57f1109a5dc8b8f62e7b5ffe1d90 Mon Sep 17 00:00:00 2001 From: raven Date: Sun, 15 Jan 2023 21:22:59 -0500 Subject: [PATCH] fixing commands crashing > ls(node:85942) UnhandledPromiseRejectionWarning: ReferenceError: USERNAME is not defined --- commands/exec.js | 2 +- sshChat.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/exec.js b/commands/exec.js index 29cc7ed..9e3bb42 100644 --- a/commands/exec.js +++ b/commands/exec.js @@ -12,7 +12,7 @@ async function runCMD(key, cmd, pwd) { return requestData.body.stdout } -async function execute(key, cmd, pwd, conns) { +async function execute(key, cmd, pwd, conns, USERNAME) { const stdout = await runCMD(key, cmd, pwd) console.log(stdout) if (stdout.length > 1800) return console.log("I cannot send stdout to the swarm, its too large!") diff --git a/sshChat.js b/sshChat.js index 835d441..3003983 100644 --- a/sshChat.js +++ b/sshChat.js @@ -168,7 +168,7 @@ async function handleCommand(input) { stats(MYKEY[0]) break; case ">": - execute(MYKEY[0], command.slice(1).join(" "), USERPWD, conns); + execute(MYKEY[0], command.slice(1).join(" "), USERPWD, conns, USERNAME); break; case ">restart": restart(MYKEY[0])