Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-12-30 18:57:07 +03:00
parent f1ef650bd5
commit 6c109415e7

View File

@ -38,14 +38,15 @@ id=$1
from=$2 from=$2
to=$3 to=$3
# get from path relative to working directory...
if [[ ${from:0:1} != '/' ]] ; then
from="$(normpath "$(pwd)/${from}")"
fi
#---------------------------------------------------------------------- #----------------------------------------------------------------------
wd=$(pwd)
# get from path relative to working directory...
if [[ ${from:0:1} != '/' ]] ; then
from="$(normpath "${wd}/${from}")"
fi
dirs=($(find "$from" -type d)) dirs=($(find "$from" -type d))
for dir in "${dirs[@]}" ; do for dir in "${dirs[@]}" ; do
if [[ "$dir" == "${to}" ]] ; then if [[ "$dir" == "${to}" ]] ; then
@ -61,7 +62,7 @@ for file in "${files[@]}" ; do
f=$(normpath "${from}/${file}") f=$(normpath "${from}/${file}")
t=$(normpath "${to}/${file}") t=$(normpath "${to}/${file}")
[ $QUIET ] \ [ $QUIET ] \
|| echo "copy: \"$f\" -> $id:\"$t\"" || echo "copy: \"${f#${wd}/}\" -> $id:\"$t\""
pct push $id "$f" "$t" pct push $id "$f" "$t"
done done