mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-07 17:27:56 +08:00
Require directly, don't spawn
This commit is contained in:
24
react-native-cli/index.js
vendored
24
react-native-cli/index.js
vendored
@@ -85,31 +85,17 @@ function init(name) {
|
||||
start: 'node_modules/react-native/packager/packager.sh'
|
||||
}
|
||||
};
|
||||
fs.writeFileSync(
|
||||
path.join(root, 'package.json'),
|
||||
JSON.stringify(packageJson, null, 2)
|
||||
);
|
||||
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson));
|
||||
process.chdir(root);
|
||||
|
||||
var initCmd = path.resolve(__dirname, '..', 'init.sh') + ' ' + projectName;
|
||||
run(initCmd, function(e) {
|
||||
run('npm install --save react-native', function(e) {
|
||||
if (e) {
|
||||
console.error('initialization failed');
|
||||
console.error('`npm install --save react-native` failed');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
run('npm install --save react-native', function(e) {
|
||||
if (e) {
|
||||
console.error('`npm install --save react-native` failed');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log('Next steps:');
|
||||
console.log('');
|
||||
console.log(' Open ' + path.join(root, projectName) + '.xcodeproj in Xcode');
|
||||
console.log(' Hit Run button');
|
||||
console.log('');
|
||||
});
|
||||
var cli = require(CLI_MODULE_PATH());
|
||||
cli.init(root, projectName);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user