packages/scripts/promoteRelease.js
/**
 * Parse and validate program arguments
 *
 * @returns {yars.argv} arguments object
 */
Parse and validate program arguments
@returns {yars.argv} arguments object
Parse and validate program arguments @returns { yars . argv } arguments object
function collectArgs() {
  const argv = yargs
    .options({
      release: {
        describe: 'What release channel to promote to',
        choices: ['preview', 'latest', 'legacy'],
        demandOption: true,
      },
      rnVersion: {
        describe: 'The semver major + minor version of the release (e.g. 0.62)',
        type: 'string',
        demandOption: true,
      },
    })
    .wrap(120)
    .version(false).argv;
  if (!argv.rnVersion.match(/\d+\.\d+/)) {
    console.error(chalk.red('Unexpected format for version (expected x.y)'));
    process.exit(1);
  }
  return argv;
}
function collectArgs ( ) { const argv = yargs . options ( { release : { describe : 'What release channel to promote to' , choices : [ 'preview' , 'latest' , 'legacy' ] , demandOption : true , } , rnVersion : { describe : 'The semver major + minor version of the release (e.g. 0.62)' , type : 'string' , demandOption : true , } , } ) . wrap ( 120 ) . version ( false ) . argv ; if ( ! argv . rnVersion . match ( / \d+\.\d+ / ) ) { console . error ( chalk . red ( 'Unexpected format for version (expected x.y)' ) ) ; process . exit ( 1 ) ; } return argv ; }
Parse and validate program arguments
 @returns {yars.argv} arguments object
Parse and validate program arguments @returns { yars . argv } arguments object