@@ -67,7 +67,9 @@ export class ImportOrchestrator {
6767 const matchedTypes = this . matchTypeIds ( typeIds , [ ...typeIdsToDependenciesMap . keys ( ) ] )
6868 await ImportOrchestrator . validate ( matchedTypes , project , pluginManager , typeIdsToDependenciesMap ) ;
6969
70- const resourceInfoList = await pluginManager . getMultipleResourceInfo ( matchedTypes ) ;
70+ const resourceInfoList = ( await pluginManager . getMultipleResourceInfo ( matchedTypes ) )
71+ . filter ( ( info ) => info . canImport )
72+
7173 const resourcesToImport = await ImportOrchestrator . getImportParameters ( reporter , project , resourceInfoList ) ;
7274 const importResult = await ImportOrchestrator . import ( pluginManager , resourcesToImport ) ;
7375
@@ -318,7 +320,7 @@ ${JSON.stringify(unsupportedTypeIds)}`);
318320
319321 reporter . displayFileModifications ( [ { file : filePath , modification : { newFile, diff } } ] ) ;
320322
321- const shouldSave = await reporter . promptConfirmation ( ' Save the changes?' ) ;
323+ const shouldSave = await reporter . promptConfirmation ( ` Save the changes? ( ${ filePath } )` ) ;
322324 if ( ! shouldSave ) {
323325 reporter . displayMessage ( '\nSkipping save! Exiting...' ) ;
324326
@@ -338,15 +340,19 @@ ${JSON.stringify(unsupportedTypeIds)}`);
338340 private static async generateNewImportFileName ( ) : Promise < string > {
339341 const cwd = process . cwd ( ) ;
340342
341- let fileName = path . join ( cwd , 'import.codify.json' )
343+ // Save codify to a new folder so it doesn't interfere with the current project
344+ const folderPath = path . join ( cwd , 'codify-imports' )
345+ await FileUtils . createFolder ( folderPath )
346+
347+ let fileName = path . join ( folderPath , 'import.codify.json' )
342348 let counter = 1 ;
343349
344350 while ( true ) {
345351 if ( ! ( await FileUtils . fileExists ( fileName ) ) ) {
346352 return fileName ;
347353 }
348354
349- fileName = path . join ( cwd , `import-${ counter } .codify.json` ) ;
355+ fileName = path . join ( folderPath , `import-${ counter } .codify.json` ) ;
350356 counter ++ ;
351357 }
352358 }
0 commit comments