@@ -27,14 +27,20 @@ export async function generateHostingConfig(dest: string, flags: CreateOptions)
27
27
28
28
if ( provider === 'skip' ) {
29
29
prompts . log . message (
30
- `${ chalk . blue ( 'hosting provider config [skip]' ) } You can configure hosting provider settings manually later.`
30
+ `${ chalk . blue (
31
+ 'hosting provider config [skip]'
32
+ ) } You can configure hosting provider settings manually later.`
31
33
) ;
34
+
32
35
return provider ;
33
36
}
34
37
35
- prompts . log . info ( `${ chalk . blue ( 'Hosting Configuration' ) } Setting up configuration for ${ provider } ` ) ;
38
+ prompts . log . info (
39
+ `${ chalk . blue ( 'Hosting Configuration' ) } Setting up configuration for ${ provider } `
40
+ ) ;
36
41
37
42
const resolvedDest = path . resolve ( dest ) ;
43
+
38
44
if ( ! fs . existsSync ( resolvedDest ) ) {
39
45
fs . mkdirSync ( resolvedDest , { recursive : true } ) ;
40
46
}
@@ -43,18 +49,24 @@ export async function generateHostingConfig(dest: string, flags: CreateOptions)
43
49
let filename : string | undefined ;
44
50
45
51
switch ( provider ) {
46
- case 'Vercel' :
47
- config = typeof vercelConfigRaw === 'string' ? vercelConfigRaw : JSON . stringify ( vercelConfigRaw , null , 2 ) ;
52
+ case 'Vercel' : {
53
+ config =
54
+ typeof vercelConfigRaw === 'string'
55
+ ? vercelConfigRaw
56
+ : JSON . stringify ( vercelConfigRaw , null , 2 ) ;
48
57
filename = 'vercel.json' ;
49
58
break ;
50
- case 'Netlify' :
59
+ }
60
+ case 'Netlify' : {
51
61
config = netlifyConfigRaw ;
52
62
filename = 'netlify.toml' ;
53
63
break ;
54
- case 'Cloudflare' :
64
+ }
65
+ case 'Cloudflare' : {
55
66
config = cloudflareConfigRaw ;
56
67
filename = '_headers' ;
57
68
break ;
69
+ }
58
70
}
59
71
60
72
if ( config && filename ) {
@@ -72,4 +84,3 @@ export async function generateHostingConfig(dest: string, flags: CreateOptions)
72
84
73
85
return provider ;
74
86
}
75
-
0 commit comments