mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
Rewrite 'react-native init' and 'react-native upgrade' without using Yeoman in preparation for templates support
Summary: This is the manually imported version of https://github.com/facebook/react-native/pull/10786 This was mostly straigthforward by replacing the local-cli folder with the version I had in my local git checkout, plus a few other files I listed with git diff --name-only. Reviewed By: hramos Differential Revision: D4201118 fbshipit-source-id: 4d0fb54b0edda9de1abba427958e420fd2ac105c
This commit is contained in:
committed by
Facebook Github Bot
parent
eddc2c90f6
commit
a477aec10d
@@ -8,13 +8,14 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const Promise = require('promise');
|
||||
|
||||
const adb = require('./adb');
|
||||
const chalk = require('chalk');
|
||||
const child_process = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const isPackagerRunning = require('../util/isPackagerRunning');
|
||||
const Promise = require('promise');
|
||||
const adb = require('./adb');
|
||||
const path = require('path');
|
||||
|
||||
// Verifies this is an Android project
|
||||
function checkAndroid(root) {
|
||||
@@ -104,7 +105,7 @@ function buildAndRun(args) {
|
||||
|
||||
if (args.configuration.toUpperCase() === 'RELEASE') {
|
||||
console.log(chalk.bold(
|
||||
`Generating the bundle for the release build...`
|
||||
'Generating the bundle for the release build...'
|
||||
));
|
||||
|
||||
child_process.execSync(`react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output ${androidProjectDir}/app/src/main/assets/index.android.bundle --assets-dest ${androidProjectDir}/app/src/main/res/`, {
|
||||
@@ -121,7 +122,7 @@ function buildAndRun(args) {
|
||||
: './gradlew';
|
||||
|
||||
console.log(chalk.bold(
|
||||
`Building and installing the app on the device (cd android && ${cmd} ${gradleArgs.join(' ')}...`
|
||||
`Building and installing the app on the device (cd android && ${cmd} ${gradleArgs.join(' ')})...`
|
||||
));
|
||||
|
||||
child_process.execFileSync(cmd, gradleArgs, {
|
||||
|
||||
Reference in New Issue
Block a user