Feature/add remote server logs (#159)

This commit is contained in:
Borja Jiménez
2024-04-14 14:34:47 +02:00
committed by GitHub
parent 75aed62d75
commit 4517ca7d2a
25 changed files with 385 additions and 26 deletions

View File

@ -108,12 +108,18 @@ public function editFile(string $path, ?string $content = null): void
);
}
public function readFile(string $path): string
public function readFile(string $path, ?int $lastLines = null): string
{
$params = [
'path' => $path,
];
if ($lastLines !== null) {
$params['lines'] = $lastLines;
}
return $this->server->ssh()->exec(
$this->getScript('read-file.sh', [
'path' => $path,
])
$this->getScript('read-file.sh', $params)
);
}