mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
code style fix
add command tests
This commit is contained in:
26
app/SSHCommands/System/RunScriptCommand.php
Normal file
26
app/SSHCommands/System/RunScriptCommand.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\SSHCommands\System;
|
||||
|
||||
use App\SSHCommands\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
class RunScriptCommand extends Command
|
||||
{
|
||||
public function __construct(protected string $path, protected string $script)
|
||||
{
|
||||
}
|
||||
|
||||
public function file(): string
|
||||
{
|
||||
return File::get(resource_path('commands/system/run-script.sh'));
|
||||
}
|
||||
|
||||
public function content(): string
|
||||
{
|
||||
return str($this->file())
|
||||
->replace('__path__', $this->path)
|
||||
->replace('__script__', $this->script)
|
||||
->toString();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user