Skip to content

Commit

Permalink
Fixing code style.
Browse files Browse the repository at this point in the history
  • Loading branch information
emerham committed Mar 16, 2023
1 parent f54183c commit 9325565
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
14 changes: 6 additions & 8 deletions src/Commands/AcquiaCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,13 @@ protected function waitForTask($response) {
switch ($notification->status) {
case self::TASKFAILED:
throw new Exception('Acquia task failed.');

case self::TASKSTARTED:
case self::TASKINPROGRESS:
break;
case self::TASKCOMPLETED:
break(2);
default:
throw new Exception('Unknown notification status.');

}
$current = new DateTime(date('c'));
$current->setTimezone($timeZone);
Expand Down Expand Up @@ -291,22 +289,22 @@ protected function rsyncFiles(string $appUuId, string $siteName, string $envUuId
$toUser = explode('@', $toUrl);
$this->taskRsync()
->fromHost($fromUrl)
->fromPath("/mnt/gfs/${fromUser[0]}/sites/${siteName}/")
->toPath("/tmp/${siteName}/")
->fromPath("/mnt/gfs/${fromUser[0]}/sites/$siteName/")
->toPath("/tmp/$siteName/")
->archive()
->compress()
->excludeVcs()
->run();
$this->taskRsync()
->fromPath("/tmp/${siteName}/")
->fromPath("/tmp/$siteName/")
->toHost($toUrl)
->toPath("/mnt/gfs/${toUser[0]}/sites/${siteName}/")
->toPath("/mnt/gfs/${toUser[0]}/sites/$siteName/")
->archive()
->compress()
->excludeVcs()
->run();
$this->say('Deleting temporary file copy.');
$this->_deleteDir("/tmp/${siteName}");
$this->_deleteDir("/tmp/$siteName");
}

/**
Expand Down Expand Up @@ -421,7 +419,7 @@ protected function deleteDomain(string $envUuId, string $domainName) {
}

/**
* Perform a application file copy command.
* Perform an application file copy command.
*
* @param string $envUuIdFrom
* The Acquia Cloud UUID Source.
Expand Down
20 changes: 10 additions & 10 deletions src/Commands/CopyFilesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,28 @@ public function copySiteFiles($appName, $site, $fromENv, $toEnv) {
$to = explode('@', $toUrl);
$rsyncDown = $this->taskRsync()
->fromHost($fromUrl)
->fromPath("/mnt/gfs/${from[0]}/sites/${site}/")
->toPath("/tmp/${site}/")
->fromPath("/mnt/gfs/${from[0]}/sites/$site/")
->toPath("/tmp/$site/")
->archive()
->compress()
->excludeVcs()
->progress();
if ('y' === $this->ask("Do you want to copy ${site} files down? (y/n)")) {
if ('y' === $this->ask("Do you want to copy $site files down? (y/n)")) {
$rsyncDown->run();
}
$rsyncUp = $this->taskRsync()
->fromPath("/tmp/${site}/")
->fromPath("/tmp/$site/")
->toHost($toUrl)
->toPath("/mnt/gfs/${to[0]}/sites/${site}/")
->toPath("/mnt/gfs/${to[0]}/sites/$site/")
->archive()
->compress()
->excludeVcs()
->progress();
if ('y' === $this->ask("Do you want to push ${site} files up? (y/n)")) {
if ('y' === $this->ask("Do you want to push $site files up? (y/n)")) {
$rsyncUp->run();
}
$this->say('Deleting temporary file copy.');
$this->_deleteDir("/tmp/${site}");
$this->_deleteDir("/tmp/$site");
}

/**
Expand Down Expand Up @@ -95,13 +95,13 @@ public function copySiteFilesDown($appName, $site, $fromEnv, $destination = NULL
$from = explode('@', $fromUrl);
$rsyncDown = $this->taskRsync()
->fromHost($fromUrl)
->fromPath("/mnt/gfs/${from[0]}/sites/${site}/")
->toPath("${destination}/${site}/")
->fromPath("/mnt/gfs/${from[0]}/sites/$site/")
->toPath("$destination/$site/")
->archive()
->compress()
->excludeVcs()
->progress();
if ('y' === $this->ask("Do you want to copy ${site} files down? (y/n)")) {
if ('y' === $this->ask("Do you want to copy $site files down? (y/n)")) {
$rsyncDown->run();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/CronCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function listCrons($options = [
// Get a list of environments for this App UUID.
$this->writeln('Getting Environment ID\'s...');
$envList = $this->getEnvironments($appUuId);
// Get the From Env for this deploy.
// Get the Env for the scheduled jobs.
$envHelper = new ChoiceQuestion('Which Environment do you want to see the domain list for...', $envList);
$environment = $this->doAsk($envHelper);
try {
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/DomainCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function domainDelete() {
$envUuId = $this->getEnvUuIdFromApp($appUuId, $environment);
}
catch (Exception $e) {
$this->say('Incorect Environment and Application id.');
$this->say('Incorrect Environment and Application id.');
}
$domainList = $this->getDomains($envUuId);
$domainDeleteHelper = new ChoiceQuestion('Which Domain(s) do you want to delete, separate multiple by comma', $domainList);
Expand Down

0 comments on commit 9325565

Please sign in to comment.