Run application using package.json scripts

Summary:
**Motivation:**
According to the meeting notes published by mkonicek yesterday, RN should support `yarn run ios` and `yarn run android` commands.

**Test plan (required)**
- [x] Generate a new project and start scaffolded app using `yarn(npm) run ios(android)`
Closes https://github.com/facebook/react-native/pull/12004

Differential Revision: D4441837

Pulled By: mkonicek

fbshipit-source-id: 250f7a9e1efc59e0caa5c2c071b59b97e14e939b
This commit is contained in:
Alexey Kureev 2017-01-20 06:42:16 -08:00 committed by Facebook Github Bot
parent 8f5a72de8e
commit bc8b23a009
1 changed files with 3 additions and 1 deletions

View File

@ -240,7 +240,9 @@ function createProject(name, options) {
version: '0.0.1', version: '0.0.1',
private: true, private: true,
scripts: { scripts: {
start: 'node node_modules/react-native/local-cli/cli.js start' start: 'node node_modules/react-native/local-cli/cli.js start',
ios: 'react-native run-ios',
android: 'react-native run-android',
} }
}; };
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson)); fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson));