@@ -81,6 +81,12 @@ protected function configure() {
8181 InputOption::VALUE_OPTIONAL ,
8282 'Specify which branch to build if different than the global branch found in sites.yml '
8383 );
84+ $ this ->addOption (
85+ 'profile ' ,
86+ '' ,
87+ InputOption::VALUE_NONE ,
88+ 'Which profile to use. i.e. standard '
89+ );
8490 $ this ->addOption (
8591 'skip ' ,
8692 '' ,
@@ -105,6 +111,7 @@ protected function interact(InputInterface $input, OutputInterface $output) {
105111 }
106112 // Trim input.
107113 $ this ->skip = array_map ('trim ' , $ this ->skip );
114+
108115 }
109116
110117 /**
@@ -119,12 +126,36 @@ protected function execute(InputInterface $input, OutputInterface $output) {
119126 $ this ->addCheckoutCommand ();
120127 $ this ->runList ();
121128
129+ $ this ->setSiteRoot ();
130+
131+ $ profile = $ input ->getOption ('profile ' );
132+ // Try to get the profile from settings.php.
133+ if (!$ profile ) {
134+ $ settingsPhp = $ this ->getSiteRoot () . 'settings.php ' ;
135+ if (file_exists ($ settingsPhp )) {
136+ $ regex = '|\$settings\[ \'install_profile \'\] = \'(\w+) \'| ' ;
137+ $ contents = file_get_contents ($ settingsPhp );
138+ preg_match ($ regex , $ contents , $ matches );
139+ if (!empty ($ matches )) {
140+ $ profile = $ matches [1 ];
141+ }
142+ }
143+ }
144+ // Ask for user input.
145+ if (!$ profile ) {
146+ $ profile = $ this ->getIo ()->ask (
147+ $ this ->trans ('Which profile would you like to install? ' ),
148+ 'standard '
149+ );
150+ }
151+ $ this ->profile = $ profile ;
152+ $ input ->setOption ('profile ' , $ profile );
153+
122154 // Run compose now because we need to have core to set the site root.
123155 $ this ->addComposeMakeCommand ();
124156 $ this ->runList ();
125157
126158 // Add entry on sites.php.
127- $ this ->setSiteRoot ();
128159 $ this ->addSitesPhp ();
129160
130161 // Queue other commands.
@@ -354,6 +385,7 @@ private function addDbImportCommand() {
354385 'command ' => 'site:db:import ' ,
355386 'arguments ' => array (
356387 'name ' => $ this ->siteName ,
388+ 'profile ' => $ this ->profile ,
357389 )
358390 );
359391 }
0 commit comments