mirror of
https://github.com/danbulant/Shasha
synced 2026-07-05 02:50:49 +00:00
better stdio handling
This commit is contained in:
parent
e6e3932d10
commit
2444e6263d
1 changed files with 8 additions and 7 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
const commando = require("@iceprod/discord.js-commando"),
|
const commando = require("@iceprod/discord.js-commando"),
|
||||||
{ exec } = require("child_process"),
|
{ exec } = require("child_process"),
|
||||||
{ errLog, trySend } = require("../../resources/functions");
|
{ trySend } = require("../../resources/functions");
|
||||||
|
|
||||||
module.exports = class update extends commando.Command {
|
module.exports = class update extends commando.Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
|
|
@ -16,12 +16,13 @@ module.exports = class update extends commando.Command {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async run(msg) {
|
async run(msg) {
|
||||||
exec("bash .update.sh", async (xe, o, e) => {
|
let ret = [];
|
||||||
if (xe || e) {
|
await exec("bash .update.sh", async (xe, o, e) => {
|
||||||
await errLog(xe || e, msg, msg.client, true, "", true);
|
for (const M of [xe, o, e])
|
||||||
}
|
if (M)
|
||||||
if (o) return trySend(msg.client, msg, o);
|
ret.push(await trySend(msg.client, msg, M));
|
||||||
return trySend(msg.client, msg, "Done");
|
ret.push(await trySend(msg.client, msg, "Done"));
|
||||||
});
|
});
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Loading…
Reference in a new issue