Skip to content

Commit

Permalink
can checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
krnsk0 committed Sep 30, 2023
1 parent a89021c commit c3660f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/topMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import kleur from 'kleur';
import { getBranches } from './utils/getBranches';
import { makeMenu } from './utils/makeMenu';
import { EXITING } from './strings';
import { checkoutBranch } from './utils/checkoutBranch';

export const menu = async () => {
const allBranches = getBranches();
Expand All @@ -10,6 +11,6 @@ export const menu = async () => {
process.exit(1);
} else {
const promptResult = await makeMenu(allBranches);
console.log(promptResult);
checkoutBranch(promptResult.branch);
}
};
2 changes: 1 addition & 1 deletion src/utils/makeMenu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('makeMenu', () => {
],
initial: 1,
message: 'Which branch should we check out?',
name: 'branches',
name: 'branch',
type: 'select',
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/makeMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MENU_MESSAGE } from '../strings';
export const makeMenu = (gitBranches: GitBranchOutput) => {
return prompts({
type: 'select',
name: 'branches',
name: 'branch',
message: MENU_MESSAGE,
choices: gitBranches.branches.map((choice) => {
return {
Expand Down

0 comments on commit c3660f3

Please sign in to comment.