Kaynağa Gözat
Remove PATH warning (#2001)
* In some cases (Ubuntu), `pyenv init -` has to be run before `pyenv init --path`.
* The warning has served its purpose by now.
pull/2003/head
native-api
5 yıl önce
işlemeyi yapan:
GitHub
ebeveyn
işleme
f7754ae6a4
Veri tabanında bu imza için bilinen anahtar bulunamadı
GPG Anahtar Kimliği: 4AEE18F83AFDEB23
2 değiştirilmiş dosya ile
0 ekleme ve
15 silme
-
libexec/pyenv-init
-
test/init.bats
|
|
|
@ -61,7 +61,6 @@ function main() { |
|
|
|
;; |
|
|
|
"print") |
|
|
|
init_dirs |
|
|
|
warn_path |
|
|
|
print_env |
|
|
|
print_completion |
|
|
|
print_shell_function |
|
|
|
@ -175,13 +174,6 @@ function print_path() { |
|
|
|
esac |
|
|
|
} |
|
|
|
|
|
|
|
function warn_path() { |
|
|
|
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 |
|
|
|
} |
|
|
|
|
|
|
|
function print_env() { |
|
|
|
case "$shell" in |
|
|
|
fish ) |
|
|
|
|
|
|
|
@ -90,13 +90,6 @@ OUT |
|
|
|
assert_line 0 "set -gx PATH '${PYENV_ROOT}/shims' \$PATH" |
|
|
|
} |
|
|
|
|
|
|
|
@test "prints a warning if shims not in PATH" { |
|
|
|
export PATH="$(perl -0x3A -ls -e 'while (<>) { chomp; ($_ ne $d) && print; }' -- -d="${PYENV_ROOT}/shims" <<<"$PATH")" |
|
|
|
run pyenv-init - |
|
|
|
assert_success |
|
|
|
assert_line 0 'echo '\''WARNING: `pyenv init -` no longer sets PATH.'\' |
|
|
|
} |
|
|
|
|
|
|
|
@test "outputs sh-compatible syntax" { |
|
|
|
run pyenv-init - bash |
|
|
|
assert_success |
|
|
|
|