Skip to content

Commit

Permalink
HOTFIX: Multiple fixes over the get files command, the pantheon donwl…
Browse files Browse the repository at this point in the history
…oad wasn't working
  • Loading branch information
rigoucr committed Aug 30, 2023
1 parent 367dd19 commit 8420e55
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Robo/Plugin/Commands/GetFilesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ public function getFiles(ConsoleIO $io, $opts = ['no-download' => FALSE]) {
*/
private function getFilesAcquia(ConsoleIO $io, $tasks, $remoteSiteName, $remoteEnv) {
/**
* Acquia CLI will automatically placed all files under docroot/sites/default/files.`
* Acquia CLI will automatically placed all files under docroot/sites/default/files.
*/
if (file_exists($this->getLocalEnvRoot() . '/docroot/sites/default/files')) {
if ($this->getCliToolStatus('acli')) {
$io->say('Syncing files from the ' . $remoteEnv . ' environment...');
$cmd = 'cd ' . $this->getLocalEnvRoot();
$cmd .= ' && acli pull:files ' . $remoteSiteName . '.' . $remoteEnv . ' default';
$tasks->addTask($this->taskExec($cmd));
$io->say('Syncing files from the ' . $remoteEnv . ' environment...');
$cmd = 'cd ' . $this->getLocalEnvRoot();
$cmd .= ' && acli pull:files ' . $remoteSiteName . '.' . $remoteEnv . ' default';
$tasks->addTask($this->taskExec($cmd));
}
else {
return 'Acquia CLI is not installed, please install and configure it: https://docs.acquia.com/acquia-cli/install/';
Expand All @@ -93,8 +93,8 @@ private function getFilesPantheon(ConsoleIO $io, array $opts, $tasks, $remoteSit
$tasks->addTask($this->taskExec($cmd));
}
$tasks->addTask($this->taskFilesystemStack()->mkdir($origFilesFolder . '/files_' . $remoteEnv));
$tasks->addTask($this->taskExec('tar xzvf ' . $origFilesFolder . '/' . $filesName . ' -C ' . $origFilesFolder . '/files_' . $remoteEnv));
$tasks->addTask($this->taskCopyDir([$origFilesFolder . '/files_' . $remoteEnv => $destFilesFolder]));
$tasks->addTask($this->taskExec('tar xzvf ' . $origFilesFolder . '/' . $filesName . ' -C ' . $origFilesFolder));
$tasks->addTask($this->taskMirrorDir([$origFilesFolder . '/files_' . $remoteEnv . '/' => $destFilesFolder . '/']));
$tasks->addTask($this->taskDeleteDir($origFilesFolder . '/files_' . $remoteEnv));
}
else {
Expand All @@ -103,5 +103,4 @@ private function getFilesPantheon(ConsoleIO $io, array $opts, $tasks, $remoteSit

return $tasks;
}

}

0 comments on commit 8420e55

Please sign in to comment.