Update to VS Code 1.52.1

This commit is contained in:
Asher
2021-02-09 16:08:37 +00:00
1351 changed files with 56560 additions and 38990 deletions

View File

@ -9,6 +9,7 @@ import { API as GitAPI, Repository } from './typings/git';
import { getOctokit } from './auth';
import { TextEncoder } from 'util';
import { basename } from 'path';
import { Octokit } from '@octokit/rest';
const localize = nls.loadMessageBundle();
@ -57,9 +58,18 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
quickpick.show();
quickpick.busy = true;
const octokit = await getOctokit();
const user = await octokit.users.getAuthenticated({});
const owner = user.data.login;
let owner: string;
let octokit: Octokit;
try {
octokit = await getOctokit();
const user = await octokit.users.getAuthenticated({});
owner = user.data.login;
} catch (e) {
// User has cancelled sign in
quickpick.dispose();
return;
}
quickpick.busy = false;
let repo: string | undefined;
@ -139,7 +149,7 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
new Promise<undefined>(c => quickpick.onDidHide(() => c(undefined)))
]);
if (!result) {
if (!result || result.length === 0) {
return;
}
@ -192,9 +202,9 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
}
const openInGitHub = 'Open In GitHub';
const action = await vscode.window.showInformationMessage(`Successfully published the '${owner}/${repo}' repository on GitHub.`, openInGitHub);
if (action === openInGitHub) {
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(githubRepository.html_url));
}
vscode.window.showInformationMessage(`Successfully published the '${owner}/${repo}' repository on GitHub.`, openInGitHub).then(action => {
if (action === openInGitHub) {
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(githubRepository.html_url));
}
});
}