File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,16 @@ public function executeScript(
4040 $ scriptName ,
4141 ]);
4242
43- if (!file_exists ($ gtCommand )) {
43+ $ spacePos = strpos ($ gtCommand , " " );
44+ $ gtCommandWithoutArguments = $ gtCommand ;
45+ if ($ spacePos > 0 ) {
46+ $ gtCommandWithoutArguments = substr (
47+ $ gtCommand ,
48+ 0 ,
49+ $ spacePos
50+ );
51+ }
52+ if (!file_exists ($ gtCommandWithoutArguments )) {
4453 $ this ->writeLine (
4554 "The current directory is not a WebEngine application. " ,
4655 Stream::ERROR
@@ -52,8 +61,17 @@ public function executeScript(
5261 $ gtCommand .= $ argString ;
5362 }
5463
64+ $ friendlyScriptName = $ gtCommandWithoutArguments ;
65+ $ slashPos = strrpos ($ gtCommandWithoutArguments , "/ " );
66+ if ($ slashPos > 0 ) {
67+ $ friendlyScriptName = substr (
68+ $ gtCommandWithoutArguments ,
69+ $ slashPos + 1
70+ );
71+ }
72+
5573 $ process = new Process ($ gtCommand );
56- $ processPool ->add ($ scriptName , $ process );
74+ $ processPool ->add ($ friendlyScriptName , $ process );
5775 }
5876
5977 $ processPool ->exec ();
Original file line number Diff line number Diff line change 66use Gt \Cli \Parameter \NamedParameter ;
77use Gt \Cli \Parameter \Parameter ;
88use Gt \Cli \Stream ;
9+ use Gt \Daemon \Pool ;
10+ use Gt \Daemon \Process ;
911
10- class RunCommand extends Command {
12+ class RunCommand extends AbstractWebEngineCommand {
1113 public function run (ArgumentValueList $ arguments = null ):void {
12- $ gtRunCommand = implode (DIRECTORY_SEPARATOR , [
13- "vendor " ,
14- "bin " ,
15- "gt-run " ,
16- ]);
17-
18- if (!file_exists ($ gtRunCommand )) {
19- $ this ->writeLine (
20- "The current directory is not a WebEngine application. " ,
21- Stream::ERROR
22- );
23- return ;
24- }
25-
26- $ cmd = implode (" " , [
27- $ gtRunCommand ,
28- ]);
29- passthru ($ cmd );
14+ $ this ->executeScript (
15+ $ arguments ,
16+ "serve " ,
17+ "build --default vendor/phpgt/webengine/build.default.json --watch " ,
18+ "cron --watch "
19+ );
3020 }
3121
3222 public function getName ():string {
You can’t perform that action at this time.
0 commit comments