Determine source_is only if destination is symlink.

This commit is contained in:
Darko Poljak 2018-11-02 14:35:06 +01:00
parent 6895ad0207
commit e860f1c792

View file

@ -33,8 +33,8 @@ destination_dir="${destination%/*}"
case "$type" in
symbolic)
cd "$destination_dir" || exit 1
source_is=$(readlink "$destination")
if [ -h "$destination" ]; then
source_is=$(readlink "$destination")
# ignore trailing slashes for comparison
if [ "${source_is%/}" = "${source%/}" ]; then
echo present