File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 9
9
parseCodemodConfig ,
10
10
} from "@codemod-com/utilities" ;
11
11
import type { TarService } from "@codemod-com/utilities" ;
12
+ import inquirer from "inquirer" ;
12
13
import type { Ora } from "ora" ;
13
14
import { getCodemodDownloadURI } from "./apis.js" ;
14
15
import type { FileDownloadServiceBlueprint } from "./fileDownloadService.js" ;
@@ -168,6 +169,27 @@ export class CodemodDownloader implements CodemodDownloaderBlueprint {
168
169
if ( config . engine === "recipe" ) {
169
170
const codemods : Codemod [ ] = [ ] ;
170
171
172
+ const { runAll } = await inquirer . prompt < { runAll : boolean } > ( {
173
+ name : "runAll" ,
174
+ type : "confirm" ,
175
+ message :
176
+ "The codemod you are trying to run is a recipe. Do you wish to run all of them?" ,
177
+ default : true ,
178
+ } ) ;
179
+
180
+ if ( ! runAll ) {
181
+ const { names } = await inquirer . prompt < { names : string [ ] } > ( {
182
+ name : "names" ,
183
+ type : "checkbox" ,
184
+ message :
185
+ "Please select the codemods you want to run (use space and arrow keys to select)" ,
186
+ choices : config . names ,
187
+ default : config . names ,
188
+ } ) ;
189
+
190
+ config . names = names ;
191
+ }
192
+
171
193
for ( const name of config . names ) {
172
194
const codemod = await this . download ( name ) ;
173
195
codemods . push ( codemod ) ;
You can’t perform that action at this time.
0 commit comments