Skip to content

Commit

Permalink
ZSH auto_name_dirs feature is troublesome :)
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Mar 2, 2011
1 parent c06f331 commit 9a3565a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions scripts/functions/rvmrc
Expand Up @@ -212,16 +212,16 @@ read anykey
# argument is passed, it will be used instead of pwd.
__rvm_project_rvmrc()
{
local cwd
local working_dir

# Get the first argument or the pwd.
cwd="${1:-"$PWD"}"
working_dir="${1:-"$PWD"}"

while : ; do

if [[ -z "$cwd" || "$HOME" = "$cwd" || "/" = "$cwd" ]] ; then
if [[ -z "$working_dir" || "$HOME" = "$working_dir" || "/" = "$working_dir" ]] ; then

if [[ -n "${rvm_rvmrc_cwd:-""}" ]] ; then
if [[ -n "${rvm_current_rvmrc:-""}" ]] ; then

if [[ ${rvm_project_rvmrc_default:-0} -eq 1 ]]; then

Expand All @@ -233,29 +233,29 @@ __rvm_project_rvmrc()

fi

unset rvm_rvmrc_cwd rvm_previous_environment
unset rvm_current_rvmrc rvm_previous_environment

fi

break

else

if [[ -f "$cwd/.rvmrc" ]] ; then
if [[ -f "$working_dir/.rvmrc" ]] ; then

if [[ "${rvm_rvmrc_cwd:-""}" != "$cwd" ]] ; then
if [[ "${rvm_current_rvmrc:-""}" != "$working_dir/.rvmrc" ]] ; then

__rvm_check_rvmrc_trustworthiness "$cwd/.rvmrc"
__rvm_check_rvmrc_trustworthiness "$working_dir/.rvmrc"

local rvm_trustworthiness_result=$?

if [[ $rvm_trustworthiness_result -eq 0 ]]; then

rvm_previous_environment="$(__rvm_environment_identifier)"

rvm_rvmrc_cwd="$cwd"
rvm_current_rvmrc="$working_dir/.rvmrc"

source "$cwd/.rvmrc"
source "$working_dir/.rvmrc"

return 0
else
Expand All @@ -266,7 +266,7 @@ __rvm_project_rvmrc()
break

else
cwd="$(dirname "$cwd")"
working_dir="$(dirname "$working_dir")"
fi
fi
done
Expand Down

0 comments on commit 9a3565a

Please sign in to comment.