Skip to content

Commit

Permalink
fix(create-app): installations, close #6
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 5, 2021
1 parent 1cf38a8 commit eae8ed2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
16 changes: 12 additions & 4 deletions packages/create-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const argv = require('minimist')(process.argv.slice(2))
const prompts = require('prompts')
const execa = require('execa')
const { cyan, blue, yellow, bold, dim, green } = require('kolorist')
const { parseNi, run } = require('@antfu/ni')
const { version } = require('./package.json')

const cwd = process.cwd()
Expand Down Expand Up @@ -108,9 +107,18 @@ async function init() {
})

if (yes) {
await run(parseNi, ['-C', related])
// await execa(pkgManager, ['-C', related, 'install'], { stdio: 'inherit' })
await execa(pkgManager, ['-C', related, 'run', 'dev'], { stdio: 'inherit' })
const { agent } = await prompts({
name: 'agent',
type: 'select',
message: 'Choose the agent',
choices: ['npm', 'yarn', 'pnpm'].map(i => ({ value: i, title: i })),
})

if (!agent)
return

await execa(agent, ['install'], { stdio: 'inherit', cwd: root })
await execa(agent, ['run', 'dev'], { stdio: 'inherit', cwd: root })
}
else {
console.log(dim('\n start it later by:\n'))
Expand Down
1 change: 0 additions & 1 deletion packages/create-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"homepage": "https://sli.dev",
"bugs": "https://github.com/slidevjs/slidev/issues",
"dependencies": {
"@antfu/ni": "^0.7.0",
"execa": "^5.0.0",
"kolorist": "^1.4.1",
"minimist": "^1.2.5",
Expand Down
3 changes: 1 addition & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eae8ed2

Please sign in to comment.