From ccfc9bb7157bcf2b65ac6f4b7b60ea1c812e73ab Mon Sep 17 00:00:00 2001 From: Miguel Martins Date: Wed, 23 Feb 2022 10:08:07 +0000 Subject: [PATCH 1/2] DQA-3575: Copy drush file. --- src/TaskRunner/Commands/BuildCommands.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/TaskRunner/Commands/BuildCommands.php b/src/TaskRunner/Commands/BuildCommands.php index 31e64ab84..90f9c8b64 100644 --- a/src/TaskRunner/Commands/BuildCommands.php +++ b/src/TaskRunner/Commands/BuildCommands.php @@ -116,18 +116,18 @@ public function buildDist(array $options = [ $tasks[] = $this->taskWriteToFile($options['dist-root'] . '/' . $options['root'] . '/VERSION.txt')->text($tag); // Copy drush.yml file. + $tasks[] = $this->taskFilesystemStack() + ->mkdir($options['dist-root'] . '/web/sites/all/drush'); if ($tk_drush = file_exists('resources/Drush/drush.yml.dist')) { $tasks[] = $this->taskFilesystemStack() ->copy($tk_drush, $options['dist-root'] . '/web/sites/all/drush/drush.yml'); - } - else { + } else { $vHost = getenv('VIRTUAL_HOST'); $vHostArray = explode(',', $vHost); $drush_options['options'] = [ 'uri' => reset($vHostArray) ]; $yaml = new Yaml(); - $this->taskFilesystemStack()->mkdir($options['dist-root'] . '/web/sites/all/drush'); file_put_contents($options['dist-root'] . '/web/sites/all/drush/drush.yml', $yaml->dump($drush_options)); } @@ -192,21 +192,21 @@ public function buildDev(array $options = [ } // Copy drush.yml file. + $tasks[] = $this->taskFilesystemStack() + ->mkdir($root . '/sites/all/drush'); if ($tk_drush = file_exists('resources/Drush/drush.yml.dist')) { $tasks[] = $this->taskFilesystemStack() ->copy($tk_drush, $root . '/sites/all/drush/drush.yml'); - } - else { + } else { $vHost = getenv('VIRTUAL_HOST'); $vHostArray = explode(',', $vHost); $drush_options['options'] = [ 'uri' => reset($vHostArray) ]; $yaml = new Yaml(); - $this->taskFilesystemStack()->mkdir($root . '/sites/all/drush'); file_put_contents($root . '/sites/all/drush/drush.yml', $yaml->dump($drush_options)); } - + // Collect and execute list of commands set on local runner.yml. $commands = $this->getConfig()->get('toolkit.build.dev.commands'); if (!empty($commands)) { From b1bc30dc2b86db18e73ac2a9c1aadca22d83796d Mon Sep 17 00:00:00 2001 From: Miguel Martins Date: Wed, 23 Feb 2022 13:07:06 +0000 Subject: [PATCH 2/2] DQA-3575: Copy drush file. --- src/TaskRunner/Commands/BuildCommands.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/TaskRunner/Commands/BuildCommands.php b/src/TaskRunner/Commands/BuildCommands.php index 90f9c8b64..a5775d7f4 100644 --- a/src/TaskRunner/Commands/BuildCommands.php +++ b/src/TaskRunner/Commands/BuildCommands.php @@ -116,8 +116,6 @@ public function buildDist(array $options = [ $tasks[] = $this->taskWriteToFile($options['dist-root'] . '/' . $options['root'] . '/VERSION.txt')->text($tag); // Copy drush.yml file. - $tasks[] = $this->taskFilesystemStack() - ->mkdir($options['dist-root'] . '/web/sites/all/drush'); if ($tk_drush = file_exists('resources/Drush/drush.yml.dist')) { $tasks[] = $this->taskFilesystemStack() ->copy($tk_drush, $options['dist-root'] . '/web/sites/all/drush/drush.yml'); @@ -128,7 +126,12 @@ public function buildDist(array $options = [ 'uri' => reset($vHostArray) ]; $yaml = new Yaml(); - file_put_contents($options['dist-root'] . '/web/sites/all/drush/drush.yml', $yaml->dump($drush_options)); + $yaml_content = $yaml->dump($drush_options); + $yaml_destination = $options['dist-root'] . '/web/sites/all/drush/drush.yml'; + $tasks[] = $this->taskFilesystemStack() + ->mkdir($options['dist-root'] . '/web/sites/all/drush') + ->touch($yaml_destination); + $tasks[] = $this->taskWriteToFile($yaml_destination)->text($yaml_content); } // Collect and execute list of commands set on local runner.yml. @@ -192,8 +195,6 @@ public function buildDev(array $options = [ } // Copy drush.yml file. - $tasks[] = $this->taskFilesystemStack() - ->mkdir($root . '/sites/all/drush'); if ($tk_drush = file_exists('resources/Drush/drush.yml.dist')) { $tasks[] = $this->taskFilesystemStack() ->copy($tk_drush, $root . '/sites/all/drush/drush.yml'); @@ -204,7 +205,12 @@ public function buildDev(array $options = [ 'uri' => reset($vHostArray) ]; $yaml = new Yaml(); - file_put_contents($root . '/sites/all/drush/drush.yml', $yaml->dump($drush_options)); + $yaml_content = $yaml->dump($drush_options); + $yaml_destination = $root . '/sites/all/drush/drush.yml'; + $tasks[] = $this->taskFilesystemStack() + ->mkdir($root . '/sites/all/drush') + ->touch($yaml_destination); + $tasks[] = $this->taskWriteToFile($yaml_destination)->text($yaml_content); } // Collect and execute list of commands set on local runner.yml.