Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function askBranches(dir) {
let branches = getRemoteBranches(dir);
let baseBranchCandidate = ['develop', 'dev', 'master'].find(item =>
branches.includes(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',
name: 'baseBranch',
choices: branches,