wip
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Process\Pipe;
|
||||
use Illuminate\Support\Facades\Process;
|
||||
|
||||
class GitPullController extends Controller
|
||||
@@ -13,9 +14,12 @@ class GitPullController extends Controller
|
||||
'command' => ['sometimes', 'string']
|
||||
]);
|
||||
|
||||
$result = Process::path(base_path())->run(
|
||||
$request->filled('command') ? $request->filled('command') : 'git pull'
|
||||
);
|
||||
$result = Process::pipe(function (Pipe $pipe) {
|
||||
$pipe->command('ls -la');
|
||||
// $pipe->command('grep -i "laravel"');
|
||||
}, function (string $type, string $output) {
|
||||
echo $output;
|
||||
});
|
||||
|
||||
return [
|
||||
'successful' => $result->successful(),
|
||||
|
||||
Reference in New Issue
Block a user