Skip to content

Commit

Permalink
dereference symlinked datafile
Browse files Browse the repository at this point in the history
Closes rupa#163
  • Loading branch information
rupa committed Jul 26, 2017
1 parent 3eb6444 commit 0a47c9c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions z.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0a47c9c

Please sign in to comment.