mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-16 23:33:45 -05:00
init: in setup mode, default to --no-rehash
When `rbenv init` is invoked to automatically edit shell startup files, the generated lines will be invoking `rbenv init - --no-rehash` by default to help speed up shell startup. Auto-rehashing on every shell startup can be slow for some users but is not crucial to rbenv operation. Lets assume that rbenv shims are already healthy and that they will be regenerated as needed after installing new ruby versions and gems.
This commit is contained in:
@@ -57,7 +57,7 @@ OUT
|
||||
assert_success "writing ~/.bash_profile: now configured for rbenv."
|
||||
run cat ~/.bash_profile
|
||||
# shellcheck disable=SC2016
|
||||
assert_line 'eval "$(rbenv init - bash)"'
|
||||
assert_line 'eval "$(rbenv init - --no-rehash bash)"'
|
||||
}
|
||||
|
||||
@test "set up bash (bashrc)" {
|
||||
@@ -68,7 +68,7 @@ OUT
|
||||
assert_success "writing ~/.bashrc: now configured for rbenv."
|
||||
run cat ~/.bashrc
|
||||
# shellcheck disable=SC2016
|
||||
assert_line 'eval "$(rbenv init - bash)"'
|
||||
assert_line 'eval "$(rbenv init - --no-rehash bash)"'
|
||||
}
|
||||
|
||||
@test "set up zsh" {
|
||||
@@ -78,7 +78,7 @@ OUT
|
||||
assert_success "writing ~/.zprofile: now configured for rbenv."
|
||||
run cat ~/.zprofile
|
||||
# shellcheck disable=SC2016
|
||||
assert_line 'eval "$(rbenv init - zsh)"'
|
||||
assert_line 'eval "$(rbenv init - --no-rehash zsh)"'
|
||||
}
|
||||
|
||||
@test "set up zsh (zshrc)" {
|
||||
@@ -89,7 +89,7 @@ OUT
|
||||
assert_success "writing ~/.zshrc: now configured for rbenv."
|
||||
run cat ~/.zshrc
|
||||
# shellcheck disable=SC2016
|
||||
assert_line 'eval "$(rbenv init - zsh)"'
|
||||
assert_line 'eval "$(rbenv init - --no-rehash zsh)"'
|
||||
}
|
||||
|
||||
@test "set up fish" {
|
||||
@@ -97,7 +97,7 @@ OUT
|
||||
run rbenv-init fish
|
||||
assert_success "writing ~/.config/fish/config.fish: now configured for rbenv."
|
||||
run cat ~/.config/fish/config.fish
|
||||
assert_line 'status --is-interactive; and rbenv init - fish | source'
|
||||
assert_line 'status --is-interactive; and rbenv init - --no-rehash fish | source'
|
||||
}
|
||||
|
||||
@test "set up multiple shells at once" {
|
||||
|
||||
Reference in New Issue
Block a user