use blade as conmmands template (#444)

* use blade as conmmands template

* fix lint

* fix ssl
This commit is contained in:
Saeed Vaziry
2025-01-27 21:27:58 +01:00
committed by GitHub
parent a73476c1dd
commit cdbde063f0
208 changed files with 1080 additions and 1012 deletions

View File

@ -2,20 +2,21 @@
namespace App\SSH\Storage;
use App\SSH\HasScripts;
use App\Exceptions\SSHError;
class Local extends AbstractStorage
{
use HasScripts;
/**
* @throws SSHError
*/
public function upload(string $src, string $dest): array
{
$destDir = dirname($dest);
$this->server->ssh()->exec(
$this->getScript('local/upload.sh', [
view('ssh.storage.local.upload', [
'src' => $src,
'dest_dir' => $destDir,
'dest_file' => $dest,
'destDir' => $destDir,
'destFile' => $dest,
]),
'upload-to-local'
);
@ -25,10 +26,13 @@ public function upload(string $src, string $dest): array
];
}
/**
* @throws SSHError
*/
public function download(string $src, string $dest): void
{
$this->server->ssh()->exec(
$this->getScript('local/download.sh', [
view('ssh.storage.local.download', [
'src' => $src,
'dest' => $dest,
]),
@ -36,6 +40,9 @@ public function download(string $src, string $dest): void
);
}
/**
* @throws SSHError
*/
public function delete(string $src): void
{
$this->server->os()->deleteFile($src);