Commit d12a40b2 authored by nanahira's avatar nanahira

Merge branch 'v3-newpackager' of git.mycard.moe:mycard/mycard into v3-newpackager

parents c5f1b936 f8c04c15
......@@ -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