Permalink
Browse files

Bugfix: zsh cd loading.

  • Loading branch information...
1 parent 67a9b77 commit 7307186d3786420a2afd91eebee5e1f4abe19681 @wayneeseguin wayneeseguin committed Mar 3, 2011
Showing with 9 additions and 23 deletions.
  1. +8 −23 scripts/cd
  2. +1 −0 scripts/functions/rvmrc
View
@@ -4,18 +4,14 @@
# To disable this fature, set export rvm_project_rvmrc=0 in $HOME/.rvmrc
if [[ ${rvm_project_rvmrc:-1} -ne 0 ]] ; then
- if [[ -n "${ZSH_VERSION:-}" ]] ; then
-
- __rvm_after_cd() {
+ __rvm_after_cd()
+ {
+ rvm_hook="after_cd"
+ source "${rvm_scripts_path:-"$rvm_path/scripts"}/hook"
+ #__rvm_unset_exports
+ }
- rvm_hook="after_cd"
-
- true ${rvm_scripts_path:="$rvm_path/scripts"}
- local sp="$rvm_scripts_path"
- source "$rvm_scripts_path/initialize"
- source "$sp/hook"
- __rvm_unset_exports
- }
+ if [[ -n "${ZSH_VERSION:-}" ]] ; then
autoload is-at-least
@@ -31,10 +27,6 @@ if [[ ${rvm_project_rvmrc:-1} -ne 0 ]] ; then
builtin cd "$@"
local result=$?
- true ${rvm_scripts_path:="$rvm_path/scripts"}
- source "$rvm_scripts_path/initialize"
- local sp="$rvm_scripts_path"
-
__rvm_project_rvmrc
__rvm_after_cd
@@ -50,15 +42,8 @@ if [[ ${rvm_project_rvmrc:-1} -ne 0 ]] ; then
builtin cd "$@"
local result=$?
- true ${rvm_scripts_path:="$rvm_path/scripts"}
- source "$rvm_scripts_path/initialize"
-
- local sp="$rvm_scripts_path"
- source "$rvm_scripts_path/initialize"
__rvm_project_rvmrc
- rvm_hook="after_cd"
- source "$sp/hook"
- __rvm_unset_exports
+ __rvm_after_cd
return $result
}
View
@@ -213,6 +213,7 @@ read anykey
__rvm_project_rvmrc()
{
local working_dir
+ source "${rvm_scripts_path:-"$rvm_path/scripts"}/initialize"
# Get the first argument or the pwd.
working_dir="${1:-"$PWD"}"

0 comments on commit 7307186

Please sign in to comment.