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 ccfc9bb commit b1bc30d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/TaskRunner/Commands/BuildCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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.
Expand Down Expand Up @@ -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');
Expand All @@ -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.
Expand Down

0 comments on commit b1bc30d

Please sign in to comment.