Attempt at a fix?
parent
d098ac1832
commit
1aeb51eb7a
|
@ -37,8 +37,6 @@ export default class Util {
|
||||||
let output = '';
|
let output = '';
|
||||||
const writeFunction = (data: string|Buffer|Error) => {
|
const writeFunction = (data: string|Buffer|Error) => {
|
||||||
if (data instanceof Error) error = true;
|
if (data instanceof Error) error = true;
|
||||||
if (data instanceof Error) this.client.getDMChannel('253600545972027394').then((c) => c.createMessage('error'));
|
|
||||||
this.client.getDMChannel('253600545972027394').then((c) => c.createMessage(data.toString()));
|
|
||||||
output += `${data}`;
|
output += `${data}`;
|
||||||
};
|
};
|
||||||
const cmd = childProcess.exec(command, options);
|
const cmd = childProcess.exec(command, options);
|
||||||
|
@ -49,7 +47,7 @@ export default class Util {
|
||||||
cmd.stdout.off('data', writeFunction);
|
cmd.stdout.off('data', writeFunction);
|
||||||
cmd.stderr.off('data', writeFunction);
|
cmd.stderr.off('data', writeFunction);
|
||||||
cmd.off('error', writeFunction);
|
cmd.off('error', writeFunction);
|
||||||
if (error) rej(new Error(output));
|
if (code !== 0) rej(new Error(output));
|
||||||
res(output);
|
res(output);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue