-
Notifications
You must be signed in to change notification settings - Fork 14
Use SHELL environment variable before falling back to /bin/bash #81
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,6 +122,8 @@ private static function create_prompt_cmd( $prompt, $history_path ) { | |
| $history_path = escapeshellarg( $history_path ); | ||
| if ( getenv( 'WP_CLI_CUSTOM_SHELL' ) ) { | ||
| $shell_binary = getenv( 'WP_CLI_CUSTOM_SHELL' ); | ||
| } elseif ( getenv( 'SHELL' ) ) { | ||
| $shell_binary = getenv( 'SHELL' ); | ||
| } else { | ||
| $shell_binary = '/bin/bash'; | ||
|
Comment on lines
123
to
128
|
||
| } | ||
swissspidy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This scenario doesn't clearly validate the new behavior of preferring
$SHELL, because settingSHELL=/bin/bashmatches the existing hardcoded fallback and would succeed even without the code change. Consider asserting a bash path that differs from/bin/bash(e.g. via a resolved bash path) or otherwise structuring the test so it fails on the old behavior but passes on the new one.