mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Fix shell version when invoked from a script
When invoked from a shell script, `$(rbenv init -)` did not get the shell name correct. It needs to look at the `args` value from `ps`. Ref: https://github.com/yyuu/pyenv/issues/373
This commit is contained in:
parent
f9d8b551dc
commit
32030e2ed9
1 changed files with 1 additions and 1 deletions
|
@ -33,7 +33,7 @@ done
|
|||
|
||||
shell="$1"
|
||||
if [ -z "$shell" ]; then
|
||||
shell="$(ps c -p "$PPID" -o 'ucomm=' 2>/dev/null || true)"
|
||||
shell="$(ps -p "$PPID" -o 'args=' 2>/dev/null || true)"
|
||||
shell="${shell##-}"
|
||||
shell="${shell%% *}"
|
||||
shell="${shell:-$SHELL}"
|
||||
|
|
Loading…
Reference in a new issue