Skip to content

Commit

Permalink
use Boolean for npm flag instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ruddell committed Sep 24, 2019
1 parent 3065c2c commit 40423b5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/boilerplate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,15 @@ async function install (context) {
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'))
const useNpm = Boolean(parameters.options.npm) || !Boolean(system.which('yarn'))
print.info(`Using ${useNpm ? 'npm' : 'yarn'} as the package manager`)
props.useNpm = useNpm

props.disableInsight = Boolean(props.disableInsight)
// very hacky but correctly handles both strings and booleans and converts to boolean
// needed because it can be true or false, but if not provided it's prompted
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 40423b5

Please sign in to comment.