From c525d017171d512703d662b96815e924abd0e3d7 Mon Sep 17 00:00:00 2001 From: Iosif Miclaus Date: Tue, 5 Jan 2021 23:00:34 +0100 Subject: [PATCH 1/3] Add --local-composer flag to the install command Using this flag will use the local composer.phar binary installed at the base path instead of the global composer binary command. This is useful for systems where composer is not installed globally. --- src/Console/InstallCommand.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index 05e5208c1..94631badf 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -16,7 +16,8 @@ class InstallCommand extends Command * @var string */ protected $signature = 'jetstream:install {stack : The development stack that should be installed} - {--teams : Indicates if team support should be installed}'; + {--teams : Indicates if team support should be installed} + {--local-composer : Indicates that the local composer.phar should be use instead of the gobal composer}'; /** * The console command description. @@ -515,8 +516,12 @@ protected function installMiddlewareAfter($after, $name, $group = 'web') */ protected function requireComposerPackages($packages) { + if ($this->option('local-composer')) { + $command = ['php', 'composer.phar', 'require']; + } + $command = array_merge( - ['composer', 'require'], + $command ?? ['composer', 'require'], is_array($packages) ? $packages : func_get_args() ); From 41e65a206d18b97528eb42ef9df0dbe174383f48 Mon Sep 17 00:00:00 2001 From: Iosif Miclaus Date: Tue, 5 Jan 2021 23:23:53 +0100 Subject: [PATCH 2/3] Update --local-composer flag description --- src/Console/InstallCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index 94631badf..cad15b056 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -17,7 +17,7 @@ class InstallCommand extends Command */ protected $signature = 'jetstream:install {stack : The development stack that should be installed} {--teams : Indicates if team support should be installed} - {--local-composer : Indicates that the local composer.phar should be use instead of the gobal composer}'; + {--local-composer : Indicates that the local composer.phar binary should be used to require packages instead of the global composer binary}'; /** * The console command description. From 092c3d0ba780a1df73e1244bc51a5ad1bf95f73b Mon Sep 17 00:00:00 2001 From: Iosif Miclaus Date: Thu, 7 Jan 2021 19:51:29 +0100 Subject: [PATCH 3/3] Change flag to --composer= option accepting path --- src/Console/InstallCommand.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index cad15b056..c5bb38615 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -17,7 +17,7 @@ class InstallCommand extends Command */ protected $signature = 'jetstream:install {stack : The development stack that should be installed} {--teams : Indicates if team support should be installed} - {--local-composer : Indicates that the local composer.phar binary should be used to require packages instead of the global composer binary}'; + {--composer=global : Absolute path to the composer binary which should be used to require packages}'; /** * The console command description. @@ -516,8 +516,9 @@ protected function installMiddlewareAfter($after, $name, $group = 'web') */ protected function requireComposerPackages($packages) { - if ($this->option('local-composer')) { - $command = ['php', 'composer.phar', 'require']; + $composer = $this->option('composer'); + if ($composer !== 'global') { + $command = ['php', $composer, 'require']; } $command = array_merge(