mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-16 07:13:53 -05:00
strip initial - from the name of shell process
Avoids the case where shell detection would result in
`basename "-bash"` invocation, triggering the error:
basename: illegal option -- b
fixes #462
This commit is contained in:
@@ -23,6 +23,7 @@ done
|
|||||||
shell="$1"
|
shell="$1"
|
||||||
if [ -z "$shell" ]; then
|
if [ -z "$shell" ]; then
|
||||||
shell="$(ps c -p $(ps -p $$ -o 'ppid=' 2>/dev/null) -o 'comm=' 2>/dev/null || true)"
|
shell="$(ps c -p $(ps -p $$ -o 'ppid=' 2>/dev/null) -o 'comm=' 2>/dev/null || true)"
|
||||||
|
shell="${shell##-}"
|
||||||
shell="$(basename "${shell:-$SHELL}")"
|
shell="$(basename "${shell:-$SHELL}")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user