File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
system/Commands/Utilities Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,11 @@ public function run(array $params)
83
83
try {
84
84
$ this ->runCaching ($ enableConfigCache , $ enableLocatorCache , $ disable );
85
85
$ this ->clearCache ();
86
- $ this ->removeDevPackages ();
86
+ if ($ disable === true ) {
87
+ $ this ->reinstallDevPackages ();
88
+ } else {
89
+ $ this ->removeDevPackages ();
90
+ }
87
91
} catch (RuntimeException ) {
88
92
CLI ::error ('The "spark optimize" failed. ' );
89
93
@@ -230,4 +234,24 @@ private function removeDevPackages(): void
230
234
231
235
throw new RuntimeException (__METHOD__ );
232
236
}
237
+
238
+ private function reinstallDevPackages (): void
239
+ {
240
+ if (! defined ('VENDORPATH ' )) {
241
+ return ;
242
+ }
243
+
244
+ chdir (ROOTPATH );
245
+ passthru ('composer install ' , $ status );
246
+
247
+ if ($ status === 0 ) {
248
+ CLI ::write ('Installed Composer dev packages. ' , 'green ' );
249
+
250
+ return ;
251
+ }
252
+
253
+ CLI ::error ('Error in installing Composer dev packages. ' );
254
+
255
+ throw new RuntimeException (__METHOD__ );
256
+ }
233
257
}
You can’t perform that action at this time.
0 commit comments