File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,14 @@ export interface ScaffoldOptions {
28
28
injectNpmScripts : boolean
29
29
}
30
30
31
+ const getPackageManger = ( ) => {
32
+ const name = process . env ?. npm_config_user_agent || 'npm'
33
+ if ( name === 'npm' ) {
34
+ return 'npm'
35
+ }
36
+ return name . split ( '/' ) [ 0 ]
37
+ }
38
+
31
39
export async function init ( ) {
32
40
intro ( bold ( cyan ( ' Welcome to VitePress! ' ) ) )
33
41
@@ -196,7 +204,9 @@ export function scaffold({
196
204
}
197
205
Object . assign ( userPkg . scripts || ( userPkg . scripts = { } ) , scripts )
198
206
fs . writeFileSync ( pkgPath , JSON . stringify ( userPkg , null , 2 ) )
199
- return `Done! Now run ${ cyan ( `npm run docs:dev` ) } and start writing.${ tip } `
207
+ return `Done! Now run ${ cyan (
208
+ `${ getPackageManger ( ) } run docs:dev`
209
+ ) } and start writing.${ tip } `
200
210
} else {
201
211
return `You're all set! Now run ${ cyan (
202
212
`npx vitepress dev${ dir } `
You can’t perform that action at this time.
0 commit comments