fix hanging --wait processes

This commit is contained in:
Benjamin Pasero
2017-09-14 12:11:07 +02:00
parent a6dd83a983
commit 0e7d3cbef8
3 changed files with 24 additions and 10 deletions

View File

@@ -14,6 +14,7 @@ import pkg from 'vs/platform/node/package';
import * as fs from 'fs';
import * as paths from 'path';
import * as os from 'os';
import { whenDeleted } from 'vs/base/node/pfs';
function shouldSpawnCliProcess(argv: ParsedArgs): boolean {
return argv['list-extensions'] || !!argv['install-extension'] || !!argv['uninstall-extension'];
@@ -105,14 +106,7 @@ export function main(argv: string[]): TPromise<void> {
child.once('exit', () => c(null));
// Complete when wait marker file is deleted
const interval = setInterval(() => {
fs.exists(waitMarkerFilePath, exists => {
if (!exists) {
clearInterval(interval);
c(null);
}
});
}, 1000);
whenDeleted(waitMarkerFilePath).done(c, c);
});
}
}