vscode-basex/src/services/ChildProcess.ts
2016-01-13 18:01:51 -05:00

23 lines
No EOL
580 B
TypeScript

'use strict';
let child_process = require('child_process');
export class ChildProcess {
static async spawnAsync(executable: string, args: string[]): Promise<void> {
return new Promise<void>((resolve, reject) => {
let handle = child_process.spawn(executable, args);
handle.on('close', (code: string) => {
if (code == '0') {
resolve();
}
else {
reject(code);
}
});
});
}
}