FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

move output to beginning because it is always arry · extrabacon/python-shell@a33d588 · GitHub

Repository navigation

Commit a33d588

Browse files
committed
move output to beginning because it is always arry
Also add exitCode and exitSignal
1 parent 47aa7b6 commit a33d588

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎index.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,14 @@ export class PythonShell extends EventEmitter{
277277
* @param {Function} callback The callback function to invoke with the script results
278278
* @return {PythonShell} The PythonShell instance
279279
*/
280-
static run(scriptPath:string, options?:Options, callback?:(err?:PythonShellError, output?:any[])=>any) {
280+
static run(scriptPath:string, options?:Options, callback?:(output:ReturnType<PythonShell["parser"]>[], err?:PythonShellError, exitCode?: number, exitSignal?: string)=>any) {
281281
let pyshell = new PythonShell(scriptPath, options);
282282
let output = [];
283283

284284
return pyshell.on('message', function (message) {
285285
output.push(message);
286-
}).end(function (err) {
287-
return callback(err? err : null, output.length ? output : null);
286+
}).end(function (err, exitCode, exitSignal) {
287+
return callback(output, err? err : null, exitCode, exitSignal);
288288
});
289289
};
290290

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL