fix(nuxi): improve nuxi init output (#4612)

* Prevent redundant cd statement

* some more improvements

Co-authored-by: pooya parsa <pyapar@gmail.com>
This commit is contained in:
Max Programming 2022-04-30 00:33:46 +05:30 committed by GitHub
parent eb903bd66e
commit 22954d08ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,13 +52,17 @@ export default defineNuxtCommand({
throw e throw e
} }
// Show neet steps // Show next steps
console.log(`\n 🎉 Another ${superb.random()} Nuxt project just made! Next steps:` + [ const relativeDist = rpath(dstDir)
'', const nextSteps = [
`📁 \`cd ${rpath(dstDir)}\``, relativeDist.length > 1 && `📁 \`cd ${relativeDist}\``,
'💿 Install dependencies with `npm install` or `yarn install` or `pnpm install --shamefully-hoist`', '💿 Install dependencies with `npm install` or `yarn install` or `pnpm install --shamefully-hoist`',
'🚀 Start development server with `npm run dev` or `yarn dev` or `pnpm run dev`', '🚀 Start development server with `npm run dev` or `yarn dev` or `pnpm run dev`'
'' ].filter(Boolean)
].join('\n\n '))
consola.log(`\n ✨ Your ${superb.random()} Nuxt project is just created! Next steps:\n`)
for (const step of nextSteps) {
consola.log(` ${step}\n`)
}
} }
}) })