2016-11-28 16:17:51 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
/**
|
2018-09-11 22:27:47 +00:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2016-11-28 16:17:51 +00:00
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2018-05-11 20:32:39 +00:00
|
|
|
*
|
|
|
|
* @format
|
2016-11-28 16:17:51 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
var argv = require('minimist')(process.argv.slice(2));
|
|
|
|
var cli = require('./cli');
|
|
|
|
|
|
|
|
if (argv._.length === 0 && (argv.h || argv.help)) {
|
2018-05-11 20:32:39 +00:00
|
|
|
console.log(
|
|
|
|
[
|
|
|
|
'',
|
|
|
|
' Usage: react-native-git-upgrade [version] [options]',
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
' Commands:',
|
|
|
|
'',
|
|
|
|
' [Version] upgrades React Native and app templates to the desired version',
|
|
|
|
' (latest, if not specified)',
|
|
|
|
'',
|
|
|
|
' Options:',
|
|
|
|
'',
|
|
|
|
' -h, --help output usage information',
|
|
|
|
' -v, --version output the version number',
|
|
|
|
' --verbose output debugging info',
|
|
|
|
' --npm force using the npm client even if your project uses yarn',
|
|
|
|
'',
|
|
|
|
].join('\n'),
|
|
|
|
);
|
2016-11-28 16:17:51 +00:00
|
|
|
process.exit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (argv._.length === 0 && (argv.v || argv.version)) {
|
|
|
|
console.log(require('./package.json').version);
|
|
|
|
process.exit(0);
|
|
|
|
}
|
|
|
|
|
2018-05-11 20:32:39 +00:00
|
|
|
cli.run(argv._[0], argv).catch(console.error);
|