mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
use blade as conmmands template (#444)
* use blade as conmmands template * fix lint * fix ssl
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user