How to use the shipjs-lib.silentExec 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 / prepare / getRevisionRange.js View on Github external
const tagNotExistingMessage = `Git tag 'v${currentVersion}' doesn't exist.`;
      if (yes) {
        print(error(tagNotExistingMessage));
        print(
          info(
            'Ship.js cannot figure out since which commit you want to release.'
          )
        );
        print(info('Try again with the following option added:'));
        print(info('  --commit-from SHA'));
        exitProcess(1);
      }

      print(warning(tagNotExistingMessage));
      const commits = silentExec(`git log --pretty=format:"%h%d %s"`, {
        dir,
      })
        .toString()
        .split('\n');
      const { answer } = await inquirer.prompt([
        {
          type: 'list',
          pageSize: 10,
          name: 'answer',
          message: 'Since which commit do you want to release?',
          choices: commits.map((commit, index) => `${index + 1}) ${commit}`),
        },
      ]);
      const [, commit] = answer.split(' ');

      revisionRange = `${commit}..HEAD`;
github algolia / shipjs / packages / shipjs / src / helper / hubConfigured.js View on Github external
export default function hubConfigured() {
  return (
    silentExec(
      `yes "" | GITHUB_TOKEN=${process.env.GITHUB_TOKEN || ''} hub release`,
      {
        ignoreError: true,
      }
    ).code === 0
  );
}