[[ -d $symlink ]] will return true if the symlink points to a directory.
So the symlink will not be copied, instead a directory is created with
the symlink name and the content is copied.
Signed-off-by: Kairui Song <kasong@redhat.com>
shopt -q -s dotglob
for objectname in "$src"/*; do
[[ -e $objectname || -L $objectname ]] || continue
- if [[ -d $objectname ]]; then
+ if [[ -d $objectname ]] && [[ ! -L $objectname ]]; then
# objectname is a directory, let's compute the final directory name
object_destdir=${destdir}/${objectname#$src/}
if ! [[ -e $object_destdir ]]; then