@@ -171,7 +171,14 @@ const scaffoldStudioProject = async (absolutePath: string, installFlag: boolean)
171
171
}
172
172
} ;
173
173
174
- const scaffoldCoreProject = async ( absolutePath : string ) : Promise < void > => {
174
+ interface ScaffoldProjectOptions {
175
+ coreVersion ? : string ;
176
+ }
177
+
178
+ const scaffoldCoreProject = async (
179
+ absolutePath : string ,
180
+ { coreVersion } : ScaffoldProjectOptions = { } ,
181
+ ) : Promise < void > => {
175
182
// eslint-disable-next-line no-console
176
183
console . log ( ) ;
177
184
// eslint-disable-next-line no-console
@@ -181,7 +188,10 @@ const scaffoldCoreProject = async (absolutePath: string): Promise<void> => {
181
188
// eslint-disable-next-line no-console
182
189
console . log ( ) ;
183
190
const pkg = await findCtaPackageJson ( ) ;
184
- const files = generateProject ( { name : path . basename ( absolutePath ) , version : pkg . version } ) ;
191
+ const files = generateProject ( {
192
+ name : path . basename ( absolutePath ) ,
193
+ version : coreVersion || pkg . version ,
194
+ } ) ;
185
195
await writeFiles ( absolutePath , files ) ;
186
196
187
197
// eslint-disable-next-line no-console
@@ -237,6 +247,10 @@ const run = async () => {
237
247
describe : 'Install dependencies' ,
238
248
default : true ,
239
249
} )
250
+ . option ( 'core-version' , {
251
+ type : 'string' ,
252
+ describe : 'Use a specific version of Toolpad Core' ,
253
+ } )
240
254
. option ( 'example' , {
241
255
type : 'string' ,
242
256
describe :
@@ -297,7 +311,9 @@ const run = async () => {
297
311
await scaffoldStudioProject ( absolutePath , installFlag ) ;
298
312
} else {
299
313
// Otherwise, create a new project with Toolpad Core
300
- await scaffoldCoreProject ( absolutePath ) ;
314
+ await scaffoldCoreProject ( absolutePath , {
315
+ coreVersion : args . coreVersion ,
316
+ } ) ;
301
317
}
302
318
303
319
const changeDirectoryInstruction =
0 commit comments