wip
This commit is contained in:
@@ -11,18 +11,14 @@ class GitPullController extends Controller
|
||||
public function index(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'command' => ['sometimes', 'string']
|
||||
'command' => ['sometimes', 'string'],
|
||||
]);
|
||||
|
||||
$result = Process::pipe(function (Pipe $pipe) {
|
||||
$pipe->command('ls -la '. base_path());
|
||||
$pipe->command('ls -la '.base_path());
|
||||
// $pipe->command('grep -i "laravel"');
|
||||
});
|
||||
|
||||
return [
|
||||
'successful' => $result->successful(),
|
||||
'errorOutput' => $result->errorOutput(),
|
||||
'output' => '<pre>'.$result->output().'</pre>',
|
||||
];
|
||||
return $result->successful() ? '<pre>'.$result->output().'</pre>' : $result->errorOutput();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user