added explict path source...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2024-02-12 12:38:49 +03:00
parent aa306798fc
commit bc43cf7614
2 changed files with 20 additions and 7 deletions

0
Viewer/archive/media/img/my/work/compress-archive.sh Normal file → Executable file
View File

View File

@ -120,27 +120,33 @@ fi
DRIVE=${1} DRIVE=${1}
__BASE=$BASE
while true ; do while true ; do
BASE=$__BASE
if [[ $INTERACTIVE || ! $DRIVE ]] ; then if [[ $INTERACTIVE || ! $DRIVE ]] ; then
INTERACTIVE=1 INTERACTIVE=1
echo "Select/toggle an option:" echo "Select/toggle an option:"
echo "0) Multi flash card mode is `[[ $MULTI ]] && echo "on" || echo "off"`" echo "0) Multi flash card mode is `[[ $MULTI ]] && echo "on" || echo "off"`"
echo "1) Directoy description is: \"$TITLE\"." echo "1) Directoy description is: \"$TITLE\"."
if [[ ! $DRIVE ]] ; then if [[ ! $DRIVE ]] ; then
echo "a-z|name) type a drive letter or mount name in $BASE and start." echo "a-z|name) Type a drive letter, mount name in $BASE or path and start."
echo " (paths must start with \"/\", \"./\" or \"[A-Z]:\")"
else else
echo "a-z|name) type a drive letter or mount name in $BASE and start." echo "a-z|name) Type a drive letter, mount name in $BASE or path and start."
echo "Enter) copy drive ${DRIVE}" echo " (paths must start with \"/\", \"./\" or \"[A-Z]:\")"
echo "Enter) Copy drive ${DRIVE}"
fi fi
echo "2) build." echo "2) Build."
if ! [ -z $COMPRESSOR ] ; then if ! [ -z $COMPRESSOR ] ; then
echo "3) compresion is `[[ $COMPRESS ]] && echo "on" || echo "off"`" echo "3) Compresion is `[[ $COMPRESS ]] && echo "on" || echo "off"`"
echo "4) quit." echo "4) Quit."
else else
echo "3) quit." echo "3) Quit."
fi fi
read -ep ": " RES read -ep ": " RES
# NOTE: we can't use letters here as they will shadow
# with drive letters...
case $RES in case $RES in
# toggle multi mode... # toggle multi mode...
0) 0)
@ -179,6 +185,13 @@ while true ; do
# new drive letter... # new drive letter...
*) *)
# explicit path given...
if [[ "${RES::1}" == "/" ]] \
|| [[ "${RES::2}" == "./" ]] \
|| [[ "${RES::2}" =~ [a-zA-Z]: ]] \
&& [ -e "$RES" ] ; then
BASE=
fi
DRIVE=$RES DRIVE=$RES
;; ;;
esac esac