Add better console work to scripts

This commit is contained in:
Matt McWilliams 2021-11-29 11:30:51 -05:00
parent a3b0bfe950
commit a9456c569e
2 changed files with 6 additions and 4 deletions

View File

@ -1,11 +1,12 @@
#!/bin/bash
askContinue () {
echo "${1}"
echo "Are you ready to continue? (yes/no)"
read input
if [ "$input" != "n" ] && [ "$input" != "no" ]
then
echo "${1}"
echo "${2}"
else
exit 1
fi

View File

@ -21,10 +21,11 @@ if [[ "${3}" != "" ]]; then
fi
if [[ "${2}" == "" ]] || [[ $2 -eq 0 ]]; then
echo "Drawing focus field..."
name=`basename "${1}"`
bash field.sh "${name}"
askContinue "Starting with first frame..."
askContinue "Start with first frame?" "Starting with first frame..."
else
c=0
for svg in "${1}"*.svg ; do
@ -36,7 +37,7 @@ else
echo "Starting frame: ${filename}"
break
done
askContinue "Continuing with frame ${filename}..."
askContinue "Start with ${filename}" "Continuing with frame ${filename}..."
fi
i=0
@ -64,6 +65,6 @@ for svg in "${1}"*.svg ; do
exit
fi
askContinue "Continuing with next frame..."
askContinue "Finished frame ${filename}" "Continuing with next frame..."
done