Skip to content

Commit

Permalink
fix(setup): show master as a default branch when there is no remote…
Browse files Browse the repository at this point in the history
… yet (#466)
  • Loading branch information
Eunjae Lee authored Nov 30, 2019
1 parent 51a58a4 commit f079ba5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/shipjs/src/step/setup/askQuestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,18 @@ export default async ({ dir }) =>
});

async function askBranches(dir) {
const branches = getRemoteBranches(dir);
const baseBranchCandidate = ['develop', 'dev', 'master'].find(item =>
let branches = getRemoteBranches(dir);
let baseBranchCandidate = ['develop', 'dev', 'master'].find(item =>
branches.includes(item)
);
const releaseBranchCandidate = ['releases', 'release', 'master'].find(item =>
let releaseBranchCandidate = ['releases', 'release', 'master'].find(item =>
branches.includes(item)
);
if (branches.length === 0) {
branches = ['master'];
baseBranchCandidate = 'master';
releaseBranchCandidate = 'master';
}
const { baseBranch, releaseBranch } = await inquirer.prompt([
{
type: 'list',
Expand Down

0 comments on commit f079ba5

Please sign in to comment.