1010use SolutionForest \InspireCms \Licensing \LicenseManager ;
1111use Symfony \Component \Console \Attribute \AsCommand ;
1212
13-
1413#[AsCommand(name: 'inspirecms:install ' )]
1514class InstallCommand extends Command
1615{
@@ -28,6 +27,7 @@ public function handle()
2827 ));
2928 if (! $ license ) {
3029 $ this ->error ('License key is required. Installation aborted. ' );
30+
3131 return static ::FAILURE ;
3232 }
3333
@@ -37,7 +37,7 @@ public function handle()
3737 // 2) Publish config
3838 if ($ this ->confirm ('Do you want to publish the configuration files? ' , false )) {
3939 $ this ->call ('vendor:publish ' , [
40- '--tag ' => InspireCms::CORE_SLUG . '-config ' ,
40+ '--tag ' => InspireCms::CORE_SLUG . '-config ' ,
4141 ]);
4242 $ this ->info ('Configuration files published. ' );
4343 } else {
@@ -47,7 +47,7 @@ public function handle()
4747 // 3) Publish migrations
4848 if ($ this ->confirm ('Do you want to publish the migrations? ' , true )) {
4949 $ this ->call ('vendor:publish ' , [
50- '--tag ' => InspireCms::CORE_SLUG . '-migrations ' ,
50+ '--tag ' => InspireCms::CORE_SLUG . '-migrations ' ,
5151 ]);
5252 $ this ->info ('Migrations published. ' );
5353 } else {
@@ -75,6 +75,7 @@ public function handle()
7575 $ this ->call (ImportDefaultDataCommand::class);
7676
7777 $ this ->info ('InspireCMS installation complete! ' );
78+
7879 return static ::SUCCESS ;
7980 }
8081
@@ -96,9 +97,10 @@ private function appendLicenseToEnv($license)
9697 throw new RuntimeException ('Failed to update license in .env ' );
9798 }
9899 $ this ->info ('License key saved. ' );
100+
99101 return ;
100102 }
101-
103+
102104 // If not, append it
103105 if (file_put_contents ($ envPath , $ entry , FILE_APPEND | LOCK_EX ) === false ) {
104106 throw new RuntimeException ('Failed to append license to .env ' );
@@ -108,7 +110,7 @@ private function appendLicenseToEnv($license)
108110 if (! is_readable ($ envPath )) {
109111 chmod ($ envPath , 0644 );
110112 }
111-
113+
112114 $ this ->info ('License key saved. ' );
113115 }
114116}
0 commit comments