cacheDependencyManagers/composerConfig.js
function () {
  var version = 'UnknownComposer';
  var versionString = shell.exec('composer --version', {silent: true}).output;
  // Example below:
  //    Composer version 1.0.0-alpha9 2014-12-07 17:15:20
  var versionRegex = /Composer version (\S+)/;
  var result = versionRegex.exec(versionString);
  if (result !== null) {
    version = result[1];
  } else {
    logger.logInfo('Could not find composer version from version string: ' + versionString);
  }
  return version;
}
function () {
  var version = 'UnknownComposer';
  var versionString = shell.exec('composer --version', {silent: true}).output;
  // Example below:
  //    Composer version 1.0.0-alpha9 2014-12-07 17:15:20
  var versionRegex = /Composer version (\S+)/;
  var result = versionRegex.exec(versionString);
  if (result !== null) {
    version = result[1];
  } else {
    logger.logInfo('Could not find composer version from version string: ' + versionString);
  }
  return version;
}
function ( ) { var version = 'UnknownComposer' ; var versionString = shell . exec ( 'composer --version' , { silent : true } ) . output ; // Example below: //    Composer version 1.0.0-alpha9 2014-12-07 17:15:20 var versionRegex = / Composer version (\S+) / ; var result = versionRegex . exec ( versionString ) ; if ( result !== null ) { version = result [ 1 ] ; } else { logger . logInfo ( 'Could not find composer version from version string: ' + versionString ) ; } return version ; }
Function to extract composer version number
Function to extract composer version number