@@ -58,6 +58,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
58
58
->download ()
59
59
->extract ()
60
60
->cleanUp ()
61
+ ->dumpReadmeFile ()
61
62
->updateParameters ()
62
63
->updateComposerJson ()
63
64
->createGitIgnore ()
@@ -202,9 +203,6 @@ protected function cleanUp()
202
203
203
204
$ filesToRemove = array_merge ($ licenseFile , $ upgradeFiles , $ changelogFiles );
204
205
$ this ->fs ->remove ($ filesToRemove );
205
-
206
- $ readmeContents = sprintf ("%s \n%s \n\nA Symfony project created on %s. \n" , $ this ->projectName , str_repeat ('= ' , strlen ($ this ->projectName )), date ('F j, Y, g:i a ' ));
207
- $ this ->fs ->dumpFile ($ this ->projectDir .'/README.md ' , $ readmeContents );
208
206
} catch (\Exception $ e ) {
209
207
// don't throw an exception in case any of the Symfony-related files cannot
210
208
// be removed, because this is just an enhancement, not something mandatory
@@ -262,6 +260,25 @@ protected function displayInstallationResult()
262
260
return $ this ;
263
261
}
264
262
263
+ /**
264
+ * Dump a basic README.md file.
265
+ *
266
+ * @return NewCommand
267
+ */
268
+ protected function dumpReadmeFile ()
269
+ {
270
+ $ readmeContents = sprintf ("%s \n%s \n\nA Symfony project created on %s. \n" , $ this ->projectName , str_repeat ('= ' , strlen ($ this ->projectName )), date ('F j, Y, g:i a ' ));
271
+ try {
272
+ $ this ->fs ->dumpFile ($ this ->projectDir . '/README.md ' , $ readmeContents );
273
+ } catch (\Exception $ e ) {
274
+ // don't throw an exception in case the file could not be created,
275
+ // because this is just an enhancement, not something mandatory
276
+ // for the project
277
+ }
278
+
279
+ return $ this ;
280
+ }
281
+
265
282
/**
266
283
* Updates the Symfony parameters.yml file to replace default configuration
267
284
* values with better generated values.
0 commit comments