Skip to content

Commit

Permalink
Merge pull request #512 from ec-europa/DQA/4056
Browse files Browse the repository at this point in the history
DQA-4056: Remove drush.yml generation.
  • Loading branch information
jonhy81 authored May 3, 2022
2 parents 941e80b + 78f1c54 commit 212fc0c
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions src/TaskRunner/Commands/BuildCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,6 @@ public function buildDist(array $options = [
if (file_exists('resources/Drush/drush.yml.dist')) {
$tasks[] = $this->taskFilesystemStack()
->copy('resources/Drush/drush.yml.dist', $options['dist-root'] . '/web/sites/all/drush/drush.yml');
} else {
$sitePath = getenv('SITE_PATH');
$vHost = getenv('VIRTUAL_HOST');
$vHostArray = explode(',', $vHost);

$baseUri = empty($sitePath) ? end($vHostArray) : end($vHostArray) . $sitePath;

$drush_options['options'] = ['uri' => $baseUri];
$yaml = new Yaml();
$yaml_content = $yaml->dump($drush_options, 2, 2, Yaml::DUMP_OBJECT);
$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 @@ -199,27 +184,6 @@ public function buildDev(array $options = [
if (file_exists('resources/Drush/drush.yml.dist')) {
$tasks[] = $this->taskFilesystemStack()
->copy('resources/Drush/drush.yml.dist', $root . '/sites/all/drush/drush.yml');
} else {
if (!empty(getenv('VIRTUAL_HOST'))) {
$vHost = getenv('VIRTUAL_HOST');
} else {
$this->say("Add the 'VIRTUAL_HOST' variable to your '.env' file.");
return;
}

$vHostArray = explode(',', $vHost);
$sitePath = getenv('SITE_PATH');

$vHostArray = explode(',', $vHost);
$baseUri = empty($sitePath) ? end($vHostArray) : end($vHostArray) . $sitePath;
$drush_options['options'] = ['uri' => $baseUri];
$yaml = new Yaml();
$yaml_content = $yaml->dump($drush_options, 2, 2, Yaml::DUMP_OBJECT);
$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 212fc0c

Please sign in to comment.