fix: use real target if fishfile is a symbolic link; close #460

This commit is contained in:
Jorge Bucaran 2018-10-07 13:34:42 +09:00
parent 2a6c36b8a9
commit 73505e74cb
No known key found for this signature in database
GPG key ID: E54BA3C0E646DB30

View file

@ -159,6 +159,8 @@ function _fisher_commit
if test ! -e "$fishfile"
command touch $fishfile
echo "created empty fishfile in $fishfile" | command sed "s|$HOME|~|" >&2
else if test -L "$fishfile"
set fishfile (command readlink $fishfile)
end
_fisher_fishfile_indent (echo -s $argv\;) < $fishfile > $fishfile@
command mv -f $fishfile@ $fishfile