Skip to content

Commit

Permalink
DQA-3575: Copy drush file.
Browse files Browse the repository at this point in the history
  • Loading branch information
zarabatana committed Feb 23, 2022
1 parent 660aedf commit ccfc9bb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/TaskRunner/Commands/BuildCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit ccfc9bb

Please sign in to comment.