How to use the shipjs-lib.getRemoteBranches function in shipjs-lib

To help you get started, we’ve selected a few shipjs-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algolia / shipjs / packages / shipjs / src / step / setup / askQuestions.js View on Github external
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,