-
Notifications
You must be signed in to change notification settings - Fork 16
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
Shell binary not getting detected correctly? #66
Comments
Pretty sure this would make it easier to have the shell indifferent places and helps us not assume that it's always in I did set |
WP_CLI_CUSTOM_SHELL=/run/current-system/sw/bin/bash wp shell |
Forgot to mention I tried that too 😊 Any thoughts on my idea regarding changing the way that |
Good question. Maybe @schlessera or @danielbachhuber have some context about why the current default is a hardcoded |
I don't recall a specific reason off the top of my head. For a more definitive answer, I'd look at the original pull request(s) to see if there was a discussion around it. |
This is when it got added but I found nothing regarding why it was "hard coded" I'd be happy to test the code, but can't really write tests (on the to learn list). |
Bug Report
The shell binary '/bin/bash' is not valid.
The
wp --info
command shows the correctShell
, butwp shell
does not seem to find it. Since it's not in/bin/bash
Describe how other contributors can replicate this bug
get( 'SHELL' );
return something other than/bin/bash
wp shell
Provide a possible solution
Seems that the
wp cli info
command gets the shell binary using:getenv( 'SHELL' )
Where
wp shell
usesgetenv( 'WP_CLI_CUSTOM_SHELL' )
to check for a "custom shell", then assumes/bin/bash
is it isn't set.Why not use
$shell_binary = getenv( 'SHELL' );
instead of$shell_binary = '/bin/bash';
The text was updated successfully, but these errors were encountered: