diff --git a/README.md b/README.md index 044526e21..d8498e073 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Check out the [Sample Application for Android](https://play.google.com/store/app - Install with `npm install -g ignite-cli` - Verify version with `ignite --version` - iOS apps require [Cocoapods](https://guides.cocoapods.org/using/getting-started.html) to be installed + - Verify `pod` installation with `pod install` - Not required but highly recommended, [Reactotron](https://github.com/infinitered/reactotron) makes debugging super simple and comes preconfigured To generate an app, run the following command: diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index 7b157fe3b..d08d843c5 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -12,7 +12,7 @@ You can pass flags for each of the options. | `--skip-git` | | Skips git init | | `--skip-commit-hook` | | Skips `lint-staged` initialization | | `--react-native-version` | 0.60.0 | Install specific React Native version | -| `--yarn ` | | Uses yarn in place of npm when generating | +| `--npm ` | | Uses npm in place of yarn when generating | #### JDL App Generation diff --git a/src/boilerplate/index.js b/src/boilerplate/index.js index a06fba7af..2f0f043a3 100644 --- a/src/boilerplate/index.js +++ b/src/boilerplate/index.js @@ -58,10 +58,6 @@ async function install (context) { let jhipsterConfig let jhipsterDirectory - // does the user want to use yarn? - const useNpm = !parameters.options.yarn - ignite.useYarn = !useNpm - // if the user is passing in JDL if (parameters.options.jdl) { print.info('Importing JDL') @@ -116,12 +112,18 @@ async function install (context) { props.skipGit = parameters.options['skip-git'] props.skipCommitHook = parameters.options['skip-commit-hook'] + + // is the npm flag present, or is yarn not available? + const useNpm = JSON.parse(parameters.options.npm) || !Boolean(system.which('yarn')) + print.info(`Using ${useNpm ? 'npm' : 'yarn'} as the package manager`) props.useNpm = useNpm // very hacky but correctly handles both strings and booleans and converts to boolean props.detox = JSON.parse(props.detox) props.disableInsight = JSON.parse(props.disableInsight) - + console.log(props) + console.log(JSON.stringify(props)) + console.log(JSON.stringify(parameters.options)) // attempt to install React Native or die trying const rnInstall = await reactNative.install({ name,