Skip to content

Commit

Permalink
remove auth type picker
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Apr 27, 2020
1 parent 0fe77ce commit 644f975
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,11 +585,8 @@ export function registerGlobalCommands(context: vscode.ExtensionContext, gitAPI:

const quickpick = vscode.window.createQuickPick<vscode.QuickPickItem & { repo?: string, auth?: 'https' | 'ssh' }>();
quickpick.ignoreFocusOut = true;
quickpick.totalSteps = 2;
quickpick.title = 'Publish to Github';

quickpick.placeholder = 'Repository Name';
quickpick.step = 1;
quickpick.show();

let repo: string | undefined;
Expand Down Expand Up @@ -632,25 +629,9 @@ export function registerGlobalCommands(context: vscode.ExtensionContext, gitAPI:
}
}

if (!repo) {
quickpick.dispose();
return;
}

quickpick.value = '';
quickpick.placeholder = 'Authentication Type';
quickpick.step = 2;
quickpick.items = [
{ label: `HTTPS`, description: `Use HTTPS authentication`, alwaysShow: true, auth: 'https' },
{ label: `SSH`, description: `Use SSH authentication`, alwaysShow: true, auth: 'ssh' }
];

const pick = await getPick(quickpick);
const auth = pick?.auth;

quickpick.dispose();

if (!auth) {
if (!repo) {
return;
}

Expand All @@ -674,7 +655,7 @@ export function registerGlobalCommands(context: vscode.ExtensionContext, gitAPI:
await repository.commit('first commit', { all: true });

progress.report({ message: 'Uploading files', increment: 25 });
await repository.addRemote('origin', auth === 'ssh' ? githubRepository.ssh_url : githubRepository.clone_url);
await repository.addRemote('origin', githubRepository.clone_url);
await repository.push('origin', 'master', true);

return githubRepository;
Expand Down

0 comments on commit 644f975

Please sign in to comment.