Permalink
Browse files

dereference symlinked datafile

Closes #163
1 parent 3eb6444 commit 0a47c9ceca790604df5c9a4a2bc74aba63005c21 @rupa committed Jul 26, 2017
Showing with 3 additions and 0 deletions.
  1. +3 −0 z.sh
View
3 z.sh
@@ -31,6 +31,9 @@ _z() {
local datafile="${_Z_DATA:-$HOME/.z}"
+ # if symlink, dereference
+ [ -h "$datafile" ] && datafile=$(readlink "$datafile")
+
# bail if we don't own ~/.z and $_Z_OWNER not set
[ -z "$_Z_OWNER" -a -f "$datafile" -a ! -O "$datafile" ] && return

0 comments on commit 0a47c9c

Please sign in to comment.