Separate out continue behavior into askContinue function.
Add a step which asks if user wants to start with non-first frame
This commit is contained in:
parent
1e59d667c8
commit
054a892cea
42
draw.sh
42
draw.sh
|
@ -1,5 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
askContinue () {
|
||||
echo "Are you ready to continue? (yes/no)"
|
||||
read input
|
||||
if [ "$input" != "n" ] && [ "$input" != "no" ]
|
||||
then
|
||||
echo "${1}"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "${1}" == "" ]]; then
|
||||
echo "Please provide a directory as the first argument"
|
||||
exit 1
|
||||
|
@ -15,14 +26,19 @@ if [ "${2}" == "" ]; then
|
|||
rm -f "${number}"
|
||||
bash position.sh reset
|
||||
|
||||
echo "Are you ready to continue? (yes/no)"
|
||||
read input
|
||||
if [ "$input" != "n" ] && [ "$input" != "no" ]
|
||||
then
|
||||
echo "Starting with first frame..."
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
askContinue "Starting with first frame..."
|
||||
else
|
||||
c=0
|
||||
for svg in "${1}"*.svg ; do
|
||||
if [ "${c}" != "${2}" ]; then
|
||||
let "c=c+1"
|
||||
continue
|
||||
fi
|
||||
filename=`basename "${svg}"`
|
||||
echo "Starting frame: ${filename}"
|
||||
break
|
||||
done
|
||||
askContinue "Continuing with frame ${filename}..."
|
||||
fi
|
||||
|
||||
i=0
|
||||
|
@ -44,13 +60,7 @@ for svg in "${1}"*.svg ; do
|
|||
ax "${svg}"
|
||||
rm -f "${number}"
|
||||
bash position.sh reset
|
||||
echo "Are you ready to continue? (yes/no)"
|
||||
read input
|
||||
if [ "$input" != "n" ] && [ "$input" != "no" ]
|
||||
then
|
||||
echo "Continuing with next frame..."
|
||||
else
|
||||
break
|
||||
fi
|
||||
|
||||
askContinue "Continuing with next frame..."
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in New Issue