Archived
1
0

Sometimes an exec has no callback

How lonely.
This commit is contained in:
Asher 2019-01-30 10:26:24 -06:00 committed by Kyle Carberry
parent 20f5d8eeed
commit a0c443d8d3
No known key found for this signature in database
GPG Key ID: A0409BDB6B0B3EDB

View File

@ -32,12 +32,14 @@ export class CP {
if (typeof options === "function") { if (typeof options === "function") {
callback = options; callback = options;
} }
if (callback) {
// @ts-ignore not sure how to make this work. // @ts-ignore not sure how to make this work.
callback( callback(
error, error,
useBuffer(options) ? Buffer.from(stdout) : stdout, useBuffer(options) ? Buffer.from(stdout) : stdout,
useBuffer(options) ? Buffer.from(stderr) : stderr, useBuffer(options) ? Buffer.from(stderr) : stderr,
); );
}
}); });
// @ts-ignore TODO: not fully implemented // @ts-ignore TODO: not fully implemented