Skip to content

Commit 231ec4d

Browse files
committed
Remove files that are specific to drupal-project after create project
1 parent ec0f411 commit 231ec4d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Diff for: composer.json

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
],
5858
"post-update-cmd": [
5959
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
60+
],
61+
"post-create-project-cmd": [
62+
"DrupalProject\\composer\\ScriptHandler::removeInternalFiles"
6063
]
6164
},
6265
"extra": {

Diff for: scripts/composer/ScriptHandler.php

+21
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,27 @@ public static function createRequiredFiles(Event $event) {
6060
}
6161
}
6262

63+
/**
64+
* Remove project-internal files after create project.
65+
*/
66+
public static function removeInternalFiles(Event $event) {
67+
$fs = new Filesystem();
68+
69+
// List of files to be removed.
70+
$files = [
71+
'.travis.yml',
72+
'LICENSE',
73+
'README.md',
74+
'phpunit.xml.dist',
75+
];
76+
77+
foreach ($files as $file) {
78+
if ($fs->exists($file)) {
79+
$fs->remove($file);
80+
}
81+
}
82+
}
83+
6384
/**
6485
* Checks if the installed version of Composer is compatible.
6586
*

0 commit comments

Comments
 (0)