Skip to content

Commit

Permalink
mess
Browse files Browse the repository at this point in the history
  • Loading branch information
stovak committed Feb 6, 2025
1 parent 8e01c03 commit 2d3f621
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public function testFull(
'Module constraint: ' . $this->testModuleConstraint
);
$this->output()->writeln('Drupal Version: ' . $drupal_version);
$this->output()->writeln('Home: ' . $this->getHomeDir());
$this->output()->writeln(
'Cache settings: ' . print_r($this->cache_settings, TRUE)
);
Expand Down Expand Up @@ -687,22 +688,19 @@ public function updateKnownHosts(string $site_name) {
}
// Does the known_hosts file exist?
$this->output()->writeln('Adding the git host to known hosts file');
$addGitHostToKnownHostsCommand = sprintf(
'ssh-keyscan -p %d %s',
$gitInfo['git_port'],
$gitInfo['git_host']
);
$this->output()->writeln($addGitHostToKnownHostsCommand);
exec($addGitHostToKnownHostsCommand, $output, $return_var);
if ($return_var !== 0) {
$res = $this->taskExec('ssh-keyscan')->args(
'-p', $gitInfo['git_port'], $gitInfo['git_host'])->run();
$this->output()->writeln($res->getMessage());
if (!$res->wasSuccessful()) {
$this->output()->writeln('Failed to add git host to known hosts file');
throw new TaskException($this,
'Failed to add git host to known hosts file');
}
// append the git host to the known_hosts file
$bytesWritten = file_put_contents(
sprintf("%s/.ssh/known_hosts", $HOME),
$output, FILE_APPEND
$res->getMessage(),
FILE_APPEND,
);
if ($bytesWritten === FALSE) {
$this->output()->writeln('Failed to write to known hosts file');
Expand Down

0 comments on commit 2d3f621

Please sign in to comment.