Commit f8c04c15 authored by nanahira's avatar nanahira

fix stream problem

parent 7e956178
Pipeline #4814 failed with stages
in 1 minute and 37 seconds
......@@ -72,6 +72,10 @@ export class AppsService {
}
}
private getTarStream(p: child_process.ChildProcessWithoutNullStreams) {
return process.platform === 'win32' ? p.stderr : p.stdout;
}
private apps: Map<string, App>;
constructor(private http: Http, private settingsService: SettingsService, private ref: ApplicationRef,
......@@ -1009,10 +1013,11 @@ export class AppsService {
Logger.info('Start to extract... Command Line: ' + this.tarPath, tarArgs.join(' '));
let tarProcess = child_process.spawn(this.tarPath, tarArgs);
let rl = readline.createInterface({
input: <ReadableStream>tarProcess.stderr,
input: this.getTarStream(tarProcess),
});
rl.on('line', (input: string) => {
observer.next(input.split(' ', 2)[1]);
const line = input.split(' ', 2).pop();
observer.next(line);
});
tarProcess.on('exit', (code) => {
if (code === 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment