mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Merge branch 'pr/69763'
This commit is contained in:
commit
4e7545ba8a
|
@ -487,10 +487,10 @@ export class CommandCenter {
|
||||||
(_, token) => this.git.clone(url!, parentPath, token)
|
(_, token) => this.git.clone(url!, parentPath, token)
|
||||||
);
|
);
|
||||||
|
|
||||||
const choices = [];
|
|
||||||
let message = localize('proposeopen', "Would you like to open the cloned repository?");
|
let message = localize('proposeopen', "Would you like to open the cloned repository?");
|
||||||
const open = localize('openrepo', "Open Repository");
|
const open = localize('openrepo', "Open");
|
||||||
choices.push(open);
|
const openNewWindow = localize('openreponew', "Open in New Window");
|
||||||
|
const choices = [open, openNewWindow];
|
||||||
|
|
||||||
const addToWorkspace = localize('add', "Add to Workspace");
|
const addToWorkspace = localize('add', "Add to Workspace");
|
||||||
if (workspace.workspaceFolders) {
|
if (workspace.workspaceFolders) {
|
||||||
|
@ -515,6 +515,8 @@ export class CommandCenter {
|
||||||
commands.executeCommand('vscode.openFolder', uri);
|
commands.executeCommand('vscode.openFolder', uri);
|
||||||
} else if (result === addToWorkspace) {
|
} else if (result === addToWorkspace) {
|
||||||
workspace.updateWorkspaceFolders(workspace.workspaceFolders!.length, 0, { uri });
|
workspace.updateWorkspaceFolders(workspace.workspaceFolders!.length, 0, { uri });
|
||||||
|
} else if (result === openNewWindow) {
|
||||||
|
commands.executeCommand('vscode.openFolder', uri, true);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (/already exists and is not an empty directory/.test(err && err.stderr || '')) {
|
if (/already exists and is not an empty directory/.test(err && err.stderr || '')) {
|
||||||
|
@ -599,10 +601,10 @@ export class CommandCenter {
|
||||||
|
|
||||||
await this.git.init(repositoryPath);
|
await this.git.init(repositoryPath);
|
||||||
|
|
||||||
const choices = [];
|
|
||||||
let message = localize('proposeopen init', "Would you like to open the initialized repository?");
|
let message = localize('proposeopen init', "Would you like to open the initialized repository?");
|
||||||
const open = localize('openrepo', "Open Repository");
|
const open = localize('openrepo', "Open");
|
||||||
choices.push(open);
|
const openNewWindow = localize('openreponew', "Open in New Window");
|
||||||
|
const choices = [open, openNewWindow];
|
||||||
|
|
||||||
if (!askToOpen) {
|
if (!askToOpen) {
|
||||||
return;
|
return;
|
||||||
|
@ -621,6 +623,8 @@ export class CommandCenter {
|
||||||
commands.executeCommand('vscode.openFolder', uri);
|
commands.executeCommand('vscode.openFolder', uri);
|
||||||
} else if (result === addToWorkspace) {
|
} else if (result === addToWorkspace) {
|
||||||
workspace.updateWorkspaceFolders(workspace.workspaceFolders!.length, 0, { uri });
|
workspace.updateWorkspaceFolders(workspace.workspaceFolders!.length, 0, { uri });
|
||||||
|
} else if (result === openNewWindow) {
|
||||||
|
commands.executeCommand('vscode.openFolder', uri, true);
|
||||||
} else {
|
} else {
|
||||||
await this.model.openRepository(repositoryPath);
|
await this.model.openRepository(repositoryPath);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue