async function _main([buildNumber, compareUrl = '', circleToken = '']) {
  try {
    if (!buildNumber || isNaN(buildNumber)) {
      throw new Error(
          'Missing or invalid arguments.\n' +
          'Expected: buildNumber (number), compareUrl? (string), circleToken? (string)');
    }

    if (!compareUrl) {
      compareUrl = await getCompareUrl(buildNumber, circleToken);
    }

    const commitRangeMatch = COMPARE_URL_RE.exec(compareUrl)
    const commitRange = commitRangeMatch ? commitRangeMatch[1] : '';

    console.log(commitRange);
  } catch (err) {
    console.error(err);
    process.exit(1);
  }
}
async function _main([buildNumber, compareUrl = '', circleToken = '']) {
  try {
    if (!buildNumber || isNaN(buildNumber)) {
      throw new Error(
          'Missing or invalid arguments.\n' +
          'Expected: buildNumber (number), compareUrl? (string), circleToken? (string)');
    }

    if (!compareUrl) {
      compareUrl = await getCompareUrl(buildNumber, circleToken);
    }

    const commitRangeMatch = COMPARE_URL_RE.exec(compareUrl)
    const commitRange = commitRangeMatch ? commitRangeMatch[1] : '';

    console.log(commitRange);
  } catch (err) {
    console.error(err);
    process.exit(1);
  }
}
async function _main ( [ buildNumber , compareUrl = '' , circleToken = '' ] ) { try { if ( ! buildNumber || isNaN ( buildNumber ) ) { throw new Error ( 'Missing or invalid arguments.\n' + 'Expected: buildNumber (number), compareUrl? (string), circleToken? (string)' ) ; } if ( ! compareUrl ) { compareUrl = await getCompareUrl ( buildNumber , circleToken ) ; } const commitRangeMatch = COMPARE_URL_RE . exec ( compareUrl ) const commitRange = commitRangeMatch ? commitRangeMatch [ 1 ] : '' ; console . log ( commitRange ) ; } catch ( err ) { console . error ( err ) ; process . exit ( 1 ) ; } }
Helpers
Helpers
Main function.