File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1212use Composer \DependencyResolver \Operation \UpdateOperation ;
1313use Composer \IO \IOInterface ;
1414use Composer \Package \PackageInterface ;
15+ use Composer \EventDispatcher \EventDispatcher ;
1516
1617use Composer \Util \Filesystem ;
1718use Symfony \Component \Filesystem \Filesystem as SymfonyFilesystem ;
1819
1920class Handler {
2021
22+ const PRE_DRUPAL_SCAFFOLD_CMD = 'pre-drupal-scaffold-cmd ' ;
23+ const POST_DRUPAL_SCAFFOLD_CMD = 'post-drupal-scaffold-cmd ' ;
24+
2125 /**
2226 * @var \Composer\Composer
2327 */
@@ -102,6 +106,10 @@ public function downloadScaffold() {
102106 $ excludes = $ this ->getExcludes ();
103107 $ includes = $ this ->getIncludes ();
104108
109+ // Call any pre-scaffold scripts that may be defined.
110+ $ dispatcher = new EventDispatcher ($ this ->composer , $ this ->io );
111+ $ dispatcher ->dispatch (self ::PRE_DRUPAL_SCAFFOLD_CMD );
112+
105113 // Run Robo
106114 static ::execute (
107115 [
@@ -120,6 +128,9 @@ public function downloadScaffold() {
120128 static ::array_to_csv ($ includes ),
121129 ]
122130 );
131+
132+ // Call post-scaffold scripts.
133+ $ dispatcher ->dispatch (self ::POST_DRUPAL_SCAFFOLD_CMD );
123134 }
124135
125136 /**
You can’t perform that action at this time.
0 commit comments