Allow configuring the way CLI installs react-native

Summary:
- Added an option to override the install command in CI environments (see comment in code)
- Simplify the verbose mode
- Simplify how options are passed round

Test plan (only tested on Mac OS):

    react-native init TestApp
    react-native init TestApp --version 0.36

In both cases the app was generated, package.json contained the correct version (latest, or 0.36).

    react-native init TestApp --verbose

Saw progress bar.

    react-native init InstallCommandTest --installCommand "npm install bad-package-doesnt-exist"

404 error is printed to stdout correctly.

    react-native init TestApp --installCommand "npm install react-native"

The app was generated.

    react-native init InstallCommandTest --installCommand "npm install react-native --verbose" --verbose

Saw verbose output from npm.

Reviewed By: bestander

Differential Revision: D4284642

fbshipit-source-id: f2cdee52ab64831ae3ca064d50f23c5f73a0301f
This commit is contained in:
Martin Konicek
2016-12-06 13:21:35 -08:00
committed by Facebook Github Bot
parent d21aa92480
commit 76cd2f7bf2
2 changed files with 53 additions and 61 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-cli",
"version": "1.3.0",
"version": "2.0.0",
"license": "BSD-3-Clause",
"description": "The React Native CLI tools",
"main": "index.js",