diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-06 14:54:33 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-06 14:54:33 +1200 |
commit | fdfe1fe72f8fe358d2b64ddc9e1b58dda4d3ba90 (patch) | |
tree | 75374be5bee4e0f36f3020958fb99e8fb46e4385 /bash/bashrc.d/vr.bash | |
parent | Avoid command substitution inline declaration (diff) | |
download | dotfiles-fdfe1fe72f8fe358d2b64ddc9e1b58dda4d3ba90.tar.gz dotfiles-fdfe1fe72f8fe358d2b64ddc9e1b58dda4d3ba90.zip |
Separate declaration from assignment
Diffstat (limited to 'bash/bashrc.d/vr.bash')
-rw-r--r-- | bash/bashrc.d/vr.bash | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bash/bashrc.d/vr.bash b/bash/bashrc.d/vr.bash index 4289c15c..a8d836a3 100644 --- a/bash/bashrc.d/vr.bash +++ b/bash/bashrc.d/vr.bash @@ -1,6 +1,7 @@ # Move to the root directory of a VCS working copy vr() { - local path=${1:-$PWD} + local path + path=${1:-$PWD} path=${path%/} # Raise some helpful errors @@ -39,7 +40,8 @@ vr() { # If we have a .svn dir, iterate upwards until we find an ancestor that # doesn't; hopefully that's the root if [[ -d $path/.svn ]] ; then - local search=$path + local search + search=$path while [[ -n $search ]] ; do if [[ -d ${search%/*}/.svn ]] ; then search=${search%/*} |