Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Add --composer option to the install command #607

Merged
merged 3 commits into from
Jan 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}
{--composer=global : Absolute path to the composer binary which should be used to require packages}';

/**
* The console command description.
Expand Down Expand Up @@ -515,8 +516,13 @@ protected function installMiddlewareAfter($after, $name, $group = 'web')
*/
protected function requireComposerPackages($packages)
{
$composer = $this->option('composer');
if ($composer !== 'global') {
$command = ['php', $composer, 'require'];
}

$command = array_merge(
['composer', 'require'],
$command ?? ['composer', 'require'],
is_array($packages) ? $packages : func_get_args()
);

Expand Down