mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
Feature/add remote server logs (#159)
This commit is contained in:
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user