Skip to content

Do not set the globally installed Drush as default binary path#664

Closed
mxr576 wants to merge 1 commit intojhedstrom:mainfrom
mxr576:patch-1
Closed

Do not set the globally installed Drush as default binary path#664
mxr576 wants to merge 1 commit intojhedstrom:mainfrom
mxr576:patch-1

Conversation

@mxr576
Copy link
Copy Markdown

@mxr576 mxr576 commented Mar 11, 2024

Extra handling in connection with jhedstrom/DrupalDriver#272 and the proposed change in jhedstrom/DrupalDriver#273.

$container->setParameter('drupal.driver.drush.alias', $config['drush']['alias']);

$config['drush']['binary'] = isset($config['drush']['binary']) ? $config['drush']['binary'] : 'drush';
$config['drush']['binary'] = isset($config['drush']['binary']) ? $config['drush']['binary'] : '';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should throw a RuntimeException if the binary path is not set. alternatively, it may default to vendor/bin/drush. But leaving this empty could trigger a cascade of issues that will be hard to debug.

@AlexSkrypnyk
Copy link
Copy Markdown
Collaborator

Hey @mxr576 — thanks for raising this. You were right that defaulting to a global drush is problematic.

I've opened #799 which takes a slightly different approach — defaulting to vendor/bin/drush instead of an empty string, so it works out of the box for Composer-managed projects without risking the cascade of issues an empty path would cause.

Closing this one in favour of that approach. Appreciate you flagging it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants