Skip to content

Commit 161aa2e

Browse files
author
Amelia Wattenbeger
committed
fix exec syntax
1 parent 1828895 commit 161aa2e

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

index.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,32 +1037,32 @@ var require_exec = __commonJS({
10371037
function getExecOutput(commandLine, args, options) {
10381038
var _a, _b;
10391039
return __awaiter(this, void 0, void 0, function* () {
1040-
let stdout2 = "";
1041-
let stderr2 = "";
1040+
let stdout = "";
1041+
let stderr = "";
10421042
const stdoutDecoder = new string_decoder_1.StringDecoder("utf8");
10431043
const stderrDecoder = new string_decoder_1.StringDecoder("utf8");
10441044
const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;
10451045
const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;
10461046
const stdErrListener = (data) => {
1047-
stderr2 += stderrDecoder.write(data);
1047+
stderr += stderrDecoder.write(data);
10481048
if (originalStdErrListener) {
10491049
originalStdErrListener(data);
10501050
}
10511051
};
10521052
const stdOutListener = (data) => {
1053-
stdout2 += stdoutDecoder.write(data);
1053+
stdout += stdoutDecoder.write(data);
10541054
if (originalStdoutListener) {
10551055
originalStdoutListener(data);
10561056
}
10571057
};
10581058
const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });
10591059
const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));
1060-
stdout2 += stdoutDecoder.end();
1061-
stderr2 += stderrDecoder.end();
1060+
stdout += stdoutDecoder.end();
1061+
stderr += stderrDecoder.end();
10621062
return {
10631063
exitCode,
1064-
stdout: stdout2,
1065-
stderr: stderr2
1064+
stdout,
1065+
stderr
10661066
};
10671067
});
10681068
}
@@ -15090,16 +15090,16 @@ var main = async () => {
1509015090
main();
1509115091
function execWithOutput(command, options) {
1509215092
return new Promise(function(resolve, reject) {
15093-
(0, import_exec.exec)(command, {
15093+
(0, import_exec.exec)(command, options, {
1509415094
listeners: {
15095-
stdout: function(data) {
15096-
resolve(stdout);
15095+
stdout: function(res) {
15096+
resolve(res);
1509715097
},
15098-
stderr: function(data) {
15099-
reject(stderr);
15098+
stderr: function(res) {
15099+
reject(res);
1510015100
}
1510115101
}
15102-
}, options);
15102+
});
1510315103
});
1510415104
}
1510515105
/*

src/index.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ main()
4646

4747
function execWithOutput(command, options) {
4848
return new Promise(function (resolve, reject) {
49-
exec(command, {
49+
exec(command, options, {
5050
listeners: {
51-
stdout: function (data) {
52-
resolve(stdout)
51+
stdout: function (res) {
52+
resolve(res)
5353
},
54-
stderr: function (data) {
55-
reject(stderr)
54+
stderr: function (res) {
55+
reject(res)
5656
}
5757
}
58-
}, options)
58+
})
5959
})
6060
}
6161

0 commit comments

Comments
 (0)