Skip to content

Commit

Permalink
refactor(create-app): detects pkgManager for run instructions (#1990)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Feb 12, 2021
1 parent 2a6109a commit 2b39f58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/create-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@ async function init() {
pkg.name = path.basename(root)
write('package.json', JSON.stringify(pkg, null, 2))

const pkgManager = /yarn/.test(process.env.npm_execpath) ? 'yarn' : 'npm'

console.log(`\nDone. Now run:\n`)
if (root !== cwd) {
console.log(` cd ${path.relative(cwd, root)}`)
}
console.log(` npm install (or \`yarn\`)`)
console.log(` npm run dev (or \`yarn dev\`)`)
console.log(` ${pkgManager === 'yarn' ? `yarn` : `npm install`}`)
console.log(` ${pkgManager === 'yarn' ? `yarn dev` : `npm run dev`}`)
console.log()
}

Expand Down

0 comments on commit 2b39f58

Please sign in to comment.