File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,13 @@ function hasPnpmWorkspaceFile(cwd: string): boolean {
4444 return existsSync ( pnpmWorkspaceFilePath )
4545}
4646
47+ const nuxtVersionTags = {
48+ '3.x' : '3x' ,
49+ '4.x' : 'latest' ,
50+ }
51+
4752async function getNightlyVersion ( packageNames : string [ ] ) : Promise < { npmPackages : string [ ] , nuxtVersion : string } > {
48- const nuxtVersion = await consola . prompt (
53+ const result = await consola . prompt (
4954 'Which nightly Nuxt release channel do you want to install? (3.x or 4.x)' ,
5055 {
5156 type : 'select' ,
@@ -54,11 +59,9 @@ async function getNightlyVersion(packageNames: string[]): Promise<{ npmPackages:
5459 } ,
5560 ) as '3.x' | '4.x'
5661
57- const versions = {
58- '3.x' : '3x' ,
59- '4.x' : 'latest' ,
60- }
61- const npmPackages = packageNames . map ( p => `${ p } @npm:${ p } -nightly@${ versions [ nuxtVersion ] } ` )
62+ const nuxtVersion = typeof result === 'string' ? result : '3.x'
63+
64+ const npmPackages = packageNames . map ( p => `${ p } @npm:${ p } -nightly@${ nuxtVersionTags [ nuxtVersion ] } ` )
6265
6366 return { npmPackages, nuxtVersion }
6467}
You can’t perform that action at this time.
0 commit comments