Fixing small bugs from the refractor

This commit is contained in:
raven
2023-01-11 16:27:33 -05:00
parent aceead9064
commit 23b57275e5
2 changed files with 11 additions and 10 deletions

View File

@ -12,9 +12,14 @@ async function runCMD(key, cmd, pwd) {
return requestData.body.stdout
}
async function execute(key, cmd, pwd) {
async function execute(key, cmd, pwd, conns) {
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!")
for (const conn of conns)
conn.write(`${USERNAME}: ran ${cmd}\n${stdout}`)
}
module.exports = { execute, runCMD }