mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-15 06:43:53 -05:00
Make pyenv init --path usable as a pyenv init - substitute
We're going to eliminate the need to mandatorily use `pyenv init --path`. We can't delete it yet for backward compatibility. Besides, there's one other use case for it: to enable shims but without shell integration, e.g. for noninteractive shells. To be a full-fledged replacement for `pyenv init -` however, it needs to do rehashing.
This commit is contained in:
@@ -57,6 +57,7 @@ function main() {
|
||||
;;
|
||||
"path")
|
||||
print_path
|
||||
print_rehash
|
||||
exit 0
|
||||
;;
|
||||
"print")
|
||||
@@ -64,6 +65,7 @@ function main() {
|
||||
print_path
|
||||
print_env
|
||||
print_completion
|
||||
print_rehash
|
||||
print_shell_function
|
||||
exit 0
|
||||
;;
|
||||
@@ -168,7 +170,9 @@ function print_completion() {
|
||||
if [ -r "$completion" ]; then
|
||||
echo "source '$completion'"
|
||||
fi
|
||||
}
|
||||
|
||||
function print_rehash() {
|
||||
if [ -z "$no_rehash" ]; then
|
||||
echo 'command pyenv rehash 2>/dev/null'
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user