File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
framework/src/Console/Commands
realtime-compiler/src/Http Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 2222class ServeCommand extends Command
2323{
2424 /** @var string */
25- protected $ signature = 'serve {--host= : <comment>[default: "localhost"]</comment>}} {--port= : <comment>[default: 8080]</comment>} ' ;
25+ protected $ signature = 'serve
26+ {--host= : <comment>[default: "localhost"]</comment>}}
27+ {--port= : <comment>[default: 8080]</comment>}
28+ ' ;
2629
2730 /** @var string */
2831 protected $ description = 'Start the realtime compiler server. ' ;
Original file line number Diff line number Diff line change @@ -56,7 +56,10 @@ public function __construct()
5656 {
5757 $ this ->title = config ('hyde.name ' ).' - Dashboard ' ;
5858 $ this ->request = Request::capture ();
59- $ this ->console = new ConsoleOutput ();
59+
60+ if (((bool ) env ('HYDE_RC_REQUEST_OUTPUT ' , false )) === true ) {
61+ $ this ->console = new ConsoleOutput ();
62+ }
6063
6164 $ this ->loadFlashData ();
6265
@@ -355,7 +358,7 @@ protected function createPage(): void
355358 $ this ->abort ($ exception ->getCode (), $ exception ->getMessage ());
356359 }
357360
358- $ this ->console -> printMessage ("Created file ' $ path' " , 'dashboard@createPage ' );
361+ $ this ->writeToConsole ("Created file ' $ path' " , 'dashboard@createPage ' );
359362
360363 $ this ->flash ('justCreatedPage ' , RouteKey::fromPage ($ pageClass , $ pageClass ::pathToIdentifier ($ path ))->get ());
361364 $ this ->setJsonResponse (201 , "Created file ' $ path'! " );
@@ -510,4 +513,11 @@ protected function hasAsyncHeaders(): bool
510513 {
511514 return (getallheaders ()['X-RC-Handler ' ] ?? getallheaders ()['x-rc-handler ' ] ?? null ) === 'Async ' ;
512515 }
516+
517+ protected function writeToConsole (string $ message , string $ context = 'dashboard ' ): void
518+ {
519+ if (isset ($ this ->console )) {
520+ $ this ->console ->printMessage ($ message , $ context );
521+ }
522+ }
513523}
You can’t perform that action at this time.
0 commit comments