mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 09:50:09 +00:00
now targets ar properly searched...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
28f455a732
commit
8b643b0b36
@ -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%/}/"
|
||||||
|
# remove non-existant bases...
|
||||||
|
if ! [ -d "$d" ] ; then
|
||||||
|
unset BASES[$i]
|
||||||
|
elif [ -z $BASE ] ; then
|
||||||
|
BASE=$d
|
||||||
fi
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user