Skip to content

Commit

Permalink
GL-2368: Updated binary check for curl.
Browse files Browse the repository at this point in the history
  • Loading branch information
akashkska committed Mar 28, 2024
1 parent 07a5789 commit 9f00e5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/Command/CodeStudio/CodeStudioWizardCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Acquia\Cli\Command\CodeStudio;

use Acquia\Cli\Command\WizardCommandBase;
use Acquia\Cli\Exception\AcquiaCliException;
use Acquia\Cli\Output\Checklist;
use AcquiaCloudApi\Endpoints\Account;
use DateTime;
Expand Down Expand Up @@ -124,10 +123,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->setGitLabCiCdVariablesForPhpProject($project, $appUuid, $cloudKey, $cloudSecret, $projectAccessTokenName, $projectAccessToken, $phpVersion);
break;
case "Node_project":
$cmdOutput = $this->localMachineHelper->executeFromCmd($curlCommand);
if (!$cmdOutput->isSuccessful()) {
throw new AcquiaCliException('Unable to execute curl command. {error_message}', ['error_message' => $cmdOutput->getErrorOutput()]);
}
$this->invokeCurlCommand($curlCommand);
$this->setGitLabCiCdVariablesForNodeProject($project, $appUuid, $cloudKey, $cloudSecret, $projectAccessTokenName, $projectAccessToken, $nodeVersion);
break;
}
Expand Down
8 changes: 8 additions & 0 deletions src/Command/CommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,14 @@ protected function createMySqlDumpOnLocal(string $dbHost, string $dbUser, string
return $localFilepath;
}

protected function invokeCurlCommand(string $command, Closure $outputCallback = NULL): void {
$this->localMachineHelper->checkRequiredBinariesExist(['curl']);
$process = $this->localMachineHelper->executeFromCmd($command, $outputCallback, NULL, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
if (!$process->isSuccessful()) {
throw new AcquiaCliException('Unable to execute curl command. {error_message}', ['error_message' => $process->getErrorOutput()]);
}
}

protected function promptOpenBrowserToCreateToken(
InputInterface $input
): void {
Expand Down

0 comments on commit 9f00e5d

Please sign in to comment.