@@ -113,7 +113,7 @@ async function main() {
113
113
114
114
const response = await prompts ( [
115
115
{
116
- type : 'select' ,
116
+ type : ! ! argv . builder ? null : 'select' ,
117
117
name : 'builder' ,
118
118
message : 'Which libraries do you want to install?' ,
119
119
choices : [
@@ -128,7 +128,7 @@ async function main() {
128
128
]
129
129
} ,
130
130
{
131
- type : prev => prev === 'builder' ? 'text' : null ,
131
+ type : prev => ! ! argv . builder || prev === 'builder' ? 'text' : null ,
132
132
name : 'publicKey' ,
133
133
initial : argv . publicKey || 'obtain a FREE one at https://app.vueform.com' ,
134
134
message : 'Your Public Key: ' ,
@@ -157,7 +157,7 @@ async function main() {
157
157
inactive : 'no' ,
158
158
} ,
159
159
{
160
- type : ( prev , { builder } ) => builder === 'builder' ? null : 'select' ,
160
+ type : ( prev , { builder } ) => ! ! argv . builder || builder === 'builder' ? null : 'select' ,
161
161
name : 'theme' ,
162
162
message : 'Select a theme for your project:' ,
163
163
choices : themes
@@ -169,9 +169,22 @@ async function main() {
169
169
} ,
170
170
} )
171
171
172
- const { framework, ts, builder, publicKey } = response
172
+ const { framework, ts, publicKey } = response
173
+
174
+ console . log ( projectName )
173
175
174
- const theme = builder === 'builder' ? 'tailwind' : response . theme
176
+ /**
177
+ * Variables
178
+ */
179
+ const isBuilder = ! ! argv . builder || response . builder === 'builder'
180
+ const theme = isBuilder ? 'tailwind' : response . theme
181
+ const isAstro = framework === 'astro'
182
+ const isTs = await isTypescript ( process . cwd ( ) , framework , ts )
183
+ const isTailwind = [ 'tailwind' , 'tailwind-material' ] . indexOf ( theme ) !== - 1 || isBuilder
184
+ const isBootstrap = [ 'bootstrap' ] . indexOf ( theme ) !== - 1
185
+ const isLaravel = framework === 'laravel'
186
+ const sourcePath = path . join ( __dirname , '../' , 'templates' , isBuilder ? 'builder' : 'vueform' , framework , theme , isTs ? 'ts' : 'js' )
187
+ const targetPath = path . join ( process . cwd ( ) , projectName )
175
188
176
189
if ( projectName && framework ) {
177
190
const fw = getFramework ( framework )
@@ -217,17 +230,6 @@ async function main() {
217
230
status ( '\nInstalling dependencies...' )
218
231
await runCommand ( 'npm' , [ 'install' ] , 'install dependencies' )
219
232
220
- /**
221
- * Variables
222
- */
223
- const isAstro = framework === 'astro'
224
- const isTs = await isTypescript ( process . cwd ( ) , framework , ts )
225
- const isBuilder = builder === 'builder'
226
- const isTailwind = [ 'tailwind' , 'tailwind-material' ] . indexOf ( theme ) !== - 1 || isBuilder
227
- const isBootstrap = [ 'bootstrap' ] . indexOf ( theme ) !== - 1
228
- const isLaravel = framework === 'laravel'
229
- const sourcePath = path . join ( __dirname , '../' , 'templates' , builder , framework , theme , isTs ? 'ts' : 'js' )
230
- const targetPath = process . cwd ( )
231
233
232
234
/**
233
235
* Install Tailwind
0 commit comments