mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-10 20:43:48 -05:00
Import changes from ruby-build v20150112
This commit is contained in:
@@ -17,24 +17,32 @@ if [ "$1" = "--complete" ]; then
|
||||
exec pyenv versions --bare
|
||||
fi
|
||||
|
||||
usage() {
|
||||
# We can remove the sed fallback once pyenv 0.4.0 is widely available
|
||||
pyenv-help uninstall 2>/dev/null || sed -ne '/^#/!q;s/.//;s/.//;1,4d;p' < "$0"
|
||||
[ -z "$1" ] || exit "$1"
|
||||
}
|
||||
|
||||
if [ -z "$PYENV_ROOT" ]; then
|
||||
PYENV_ROOT="${HOME}/.pyenv"
|
||||
fi
|
||||
|
||||
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||
usage 0
|
||||
fi
|
||||
|
||||
unset FORCE
|
||||
if [ "$1" = "-f" ] || [ "$1" = "--force" ]; then
|
||||
FORCE=true
|
||||
shift
|
||||
fi
|
||||
|
||||
[ "$#" -eq 1 ] || usage 1 >&2
|
||||
|
||||
DEFINITION="$1"
|
||||
case "$DEFINITION" in
|
||||
"" | -* )
|
||||
# We can remove the sed fallback once pyenv 0.4.0 is widely available.
|
||||
{ pyenv-help uninstall 2>/dev/null ||
|
||||
sed -ne '/^#/!q;s/.\{1,2\}//;1,4d;p' < "$0"
|
||||
} >&2
|
||||
exit 1
|
||||
usage 1 >&2
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user