File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ public function __construct(
2020 private array $ rectors ,
2121 private InitFilePathsResolver $ initFilePathsResolver ,
2222 private SymfonyStyle $ symfonyStyle ,
23+ private RectorConfigsResolver $ rectorConfigsResolver ,
2324 ) {
2425 }
2526
@@ -42,6 +43,14 @@ public function createConfig(string $projectDirectory): void
4243 return ;
4344 }
4445
46+ $ mainConfigFile = $ this ->rectorConfigsResolver ->provide ()->getMainConfigFile ();
47+ if ($ mainConfigFile !== null && file_exists ($ mainConfigFile )) {
48+ $ this ->symfonyStyle ->warning (
49+ 'Register rules or sets in your " ' . basename ($ mainConfigFile ) . '" config '
50+ );
51+ return ;
52+ }
53+
4554 $ response = $ this ->symfonyStyle ->ask (
4655 'No " ' . RectorConfigsResolver::DEFAULT_CONFIG_FILE . '" config found. Should we generate it for you? ' ,
4756 'yes '
You can’t perform that action at this time.
0 commit comments