Fixing small bugs from the refractor
This commit is contained in:
@ -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 }
|
Reference in New Issue
Block a user