now targets ar properly searched...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2025-06-25 07:21:03 +03:00
parent 28f455a732
commit 8b643b0b36

View File

@ -47,18 +47,25 @@ SNAPSHOT=../../../../snapshot.sh
# base mount dir... # base mount dir...
# systems with /mnt BASES=(
if [ -d /mnt ] ; then /Volumes
BASE=/mnt /cygdrive
/run/media/$USER
# raw Cygwin /mnt
elif [ -d /cygdrive ] ; then ~/mnt
BASE=/cygdrive )
i=0
# OSX for d in "${BASES[@]}"; do
elif [ -d /Volumes ] ; then # normalize...
BASE=/Volumes BASES[$i]="${d%/}/"
fi # remove non-existant bases...
if ! [ -d "$d" ] ; then
unset BASES[$i]
elif [ -z $BASE ] ; then
BASE=$d
fi
i=$(( i + 1 ))
done
while true ; do while true ; do
@ -249,10 +256,29 @@ while true ; do
BASE= BASE=
fi fi
# sanity check... # check path...
notfound=()
if ! [ -z $BASE ] ; then
for d in "${BASES[@]}"; do
if [ -e "${d}${DRIVE}" ] ; then
BASE=$d
break
else
notfound+=("${d}${DRIVE}")
fi
i=$(( i + 1 ))
done
fi
if ! [ -e "${BASE}${DRIVE}" ] ; then if ! [ -e "${BASE}${DRIVE}" ] ; then
if [ ${#notfound[@]} == 0 ] ; then
notfound=(${BASE}${DRIVE})
fi
echo echo
echo "ERR: ${BASE}${DRIVE}: does not exist, nothing to copy." echo "ERR: Not found:"
for d in "${notfound[@]}" ; do
echo "ERR: ${d}"
done
echo "ERR: Nothing to copy."
echo echo
if [[ $INTERACTIVE || ! $DRIVE ]] ; then if [[ $INTERACTIVE || ! $DRIVE ]] ; then
continue continue