Skip to content

Commit

Permalink
use yarn by default since ignite-cli expects an --npm flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ruddell committed Sep 22, 2019
1 parent 244efe7 commit baf5ca2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 7 additions & 5 deletions src/boilerplate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit baf5ca2

Please sign in to comment.