File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,11 +28,20 @@ protected function execute(
2828 ) {
2929 $ name = $ input ->getArgument (self ::NAME_ARGUMENT );
3030 $ option = $ input ->getOption (self ::NAME_OPTION );
31- $ includeFile = dirname (__DIR__ ) . "/../FPC.php " ;
31+ $ includeFile = dirname (__DIR__ ) . "/FPC.php " ;
32+ if (!file_exists ($ includeFile )) {
33+ $ output ->writeln ("FPC.php not found in " . $ includeFile );
34+ return 0 ;
35+ }
3236 $ cmd = "grep -r \"FPC.php \" " . BP . "/pub/index.php " . " || sed -i '2 i include \"$ includeFile \";' " . BP . "/pub/index.php " ;
3337 echo $ cmd . "\n" ;
34- exec ($ cmd , $ output );
35- var_dump ($ output );
38+ $ output ->writeln ("Executing: " . $ cmd );
39+ exec ($ cmd , $ cmdOutput );
40+ if (count ($ cmdOutput ) > 0 ) {
41+ $ output ->writeln ("FPC.php was already deployed to pub/index.php " );
42+ } else {
43+ $ output ->writeln ("FPC.php deployed to pub/index.php " );
44+ }
3645 return 0 ;
3746 }
3847
You can’t perform that action at this time.
0 commit comments