aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/gt.sh
diff options
context:
space:
mode:
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:-/}"