clone dir only if dst not empty

This commit is contained in:
Thomas von Dein
2021-07-18 19:49:30 +02:00
parent 60b8c0849a
commit 06baba0514

6
jaildk
View File

@@ -989,10 +989,10 @@ clone() {
if test $srcdir = $dstdir; then
echo "$srcdir == $dstdir, ignored"
else
if test -d $dstdir; then
echo "$dstdir already exists, ignored"
if test "$(ls -l $dstdir)" = "total 0"; then
ex cpdup -x $srcdir $dstdir
else
echo cpdup -x $srcdir $dstdir
echo "$dstdir already exists, ignored"
fi
fi
else