URI for waitMarkerFilePath

This commit is contained in:
Martin Aeschlimann
2019-03-22 16:16:46 +01:00
parent d5152c6539
commit fa854de2af
16 changed files with 131 additions and 72 deletions
+15 -5
View File
@@ -421,8 +421,8 @@ export class WindowsManager implements IWindowsMainService {
}
// When run with --wait, make sure we keep the paths to wait for
if (fileInputs && openConfig.cli.wait && openConfig.cli.waitMarkerFilePath) {
fileInputs.filesToWait = { paths: [...fileInputs.filesToDiff, ...fileInputs.filesToOpen, ...fileInputs.filesToCreate], waitMarkerFileUri: URI.file(openConfig.cli.waitMarkerFilePath) };
if (fileInputs && openConfig.waitMarkerFileURI) {
fileInputs.filesToWait = { paths: [...fileInputs.filesToDiff, ...fileInputs.filesToOpen, ...fileInputs.filesToCreate], waitMarkerFileUri: openConfig.waitMarkerFileURI };
}
//
@@ -506,8 +506,9 @@ export class WindowsManager implements IWindowsMainService {
// If we got started with --wait from the CLI, we need to signal to the outside when the window
// used for the edit operation is closed or loaded to a different folder so that the waiting
// process can continue. We do this by deleting the waitMarkerFilePath.
if (openConfig.context === OpenContext.CLI && openConfig.cli.wait && openConfig.cli.waitMarkerFilePath && usedWindows.length === 1 && usedWindows[0]) {
this.waitForWindowCloseOrLoad(usedWindows[0].id).then(() => fs.unlink(openConfig.cli.waitMarkerFilePath!, _error => undefined));
const waitMarkerFileURI = openConfig.waitMarkerFileURI;
if (openConfig.context === OpenContext.CLI && waitMarkerFileURI && usedWindows.length === 1 && usedWindows[0]) {
this.waitForWindowCloseOrLoad(usedWindows[0].id).then(() => fs.unlink(waitMarkerFileURI.fsPath, _error => undefined));
}
return usedWindows;
@@ -1216,7 +1217,16 @@ export class WindowsManager implements IWindowsMainService {
}
// Open it
this.open({ context: openConfig.context, cli: openConfig.cli, forceNewWindow: true, forceEmpty: !cliArgs.length && !folderUris.length && !fileUris.length, userEnv: openConfig.userEnv, noRecentEntry: true });
const openArgs: IOpenConfiguration = {
context: openConfig.context,
cli: openConfig.cli,
forceNewWindow: true,
forceEmpty: !cliArgs.length && !folderUris.length && !fileUris.length,
userEnv: openConfig.userEnv,
noRecentEntry: true,
waitMarkerFileURI: openConfig.waitMarkerFileURI
};
this.open(openArgs);
}
private openInBrowserWindow(options: IOpenBrowserWindowOptions): ICodeWindow {