aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/vr.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-06-06 14:29:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-06-06 14:29:12 +1200
commit415f6701c246363a463f828d24a86cb3e13488b6 (patch)
tree143f1d9b0d2944a14b513c27acdb4dccd0e0f9a3 /bash/bashrc.d/vr.bash
parentUse magic-space expansion for !hist (diff)
downloaddotfiles-415f6701c246363a463f828d24a86cb3e13488b6.tar.gz
dotfiles-415f6701c246363a463f828d24a86cb3e13488b6.zip
Avoid command substitution inline declaration
Diffstat (limited to 'bash/bashrc.d/vr.bash')
-rw-r--r--bash/bashrc.d/vr.bash6
1 files changed, 4 insertions, 2 deletions
diff --git a/bash/bashrc.d/vr.bash b/bash/bashrc.d/vr.bash
index fc1de5ef..4289c15c 100644
--- a/bash/bashrc.d/vr.bash
+++ b/bash/bashrc.d/vr.bash
@@ -21,14 +21,16 @@ vr() {
fi
# Ask Git the top level
- local git_root=$(cd -- "$path" && git rev-parse --show-toplevel 2>/dev/null)
+ local git_root
+ git_root=$(cd -- "$path" && git rev-parse --show-toplevel 2>/dev/null)
if [[ -n $git_root ]] ; then
cd -- "$git_root"
return
fi
# Ask Mercurial the top level
- local hg_root=$(cd -- "$path" && hg root 2>/dev/null)
+ local hg_root
+ hg_root=$(cd -- "$path" && hg root 2>/dev/null)
if [[ -n $hg_root ]] ; then
cd -- "$hg_root"
return