Check for shims in path with pure Bash (#1978)

Closes https://github.com/pyenv/pyenv/issues/1921
This commit is contained in:
native-api 2021-06-10 03:51:59 +03:00 committed by GitHub
parent fadb3f3389
commit 859b260764
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -176,7 +176,7 @@ function print_path() {
}
function warn_path() {
if ! perl -ls0x3A -e 'while (<>) { chomp; ($_ eq $d) && exit 0; } exit 1' -- -d="${PYENV_ROOT}/shims" <<<"$PATH" ; then
if ! [[ ":${PATH}:" == *":${PYENV_ROOT}/shims:"* ]] ; then
echo 'echo '\''WARNING: `pyenv init -` no longer sets PATH.'\'
echo 'echo '\''Run `pyenv init` to see the necessary changes to make to your configuration.'\'
fi