fixing commands crashing > ls(node:85942) UnhandledPromiseRejectionWarning: ReferenceError: USERNAME is not defined
This commit is contained in:
parent
bedae93ae5
commit
cc3f62dfbf
@ -12,7 +12,7 @@ async function runCMD(key, cmd, pwd) {
|
|||||||
return requestData.body.stdout
|
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)
|
const stdout = await runCMD(key, cmd, pwd)
|
||||||
console.log(stdout)
|
console.log(stdout)
|
||||||
if (stdout.length > 1800) return console.log("I cannot send stdout to the swarm, its too large!")
|
if (stdout.length > 1800) return console.log("I cannot send stdout to the swarm, its too large!")
|
||||||
|
@ -168,7 +168,7 @@ async function handleCommand(input) {
|
|||||||
stats(MYKEY[0])
|
stats(MYKEY[0])
|
||||||
break;
|
break;
|
||||||
case ">":
|
case ">":
|
||||||
execute(MYKEY[0], command.slice(1).join(" "), USERPWD, conns);
|
execute(MYKEY[0], command.slice(1).join(" "), USERPWD, conns, USERNAME);
|
||||||
break;
|
break;
|
||||||
case ">restart":
|
case ">restart":
|
||||||
restart(MYKEY[0])
|
restart(MYKEY[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user