aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/gt.sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-11 14:52:11 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-11 14:52:11 +1300
commit6e8c6c521ae5d60427634be01b82fe61a79f192b (patch)
tree5349fc3e9838c69dbb6fd69f0234ea921ea446ea /sh/shrc.d/gt.sh
parentFactor out zsh ENV hack into one file (diff)
downloaddotfiles-6e8c6c521ae5d60427634be01b82fe61a79f192b.tar.gz
dotfiles-6e8c6c521ae5d60427634be01b82fe61a79f192b.zip
Refactor some conditionals
Diffstat (limited to 'sh/shrc.d/gt.sh')
-rw-r--r--sh/shrc.d/gt.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/sh/shrc.d/gt.sh b/sh/shrc.d/gt.sh
index 95ab4c2f..7a52571d 100644
--- a/sh/shrc.d/gt.sh
+++ b/sh/shrc.d/gt.sh
@@ -19,7 +19,9 @@ gt() {
done
# If target isn't a directory, chop to its parent
- [ -d "$1" ] || set -- "${1%/*}"
+ if ! [ -d "$1" ] ; then
+ set -- "${1%/*}"
+ fi
# Try to change into the determined directory, or root if empty
command cd -- "${1:-/}"