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
40
draw.sh
40
draw.sh
|
@ -1,5 +1,16 @@
|
||||||
#!/bin/bash
|
#!/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
|
if [[ "${1}" == "" ]]; then
|
||||||
echo "Please provide a directory as the first argument"
|
echo "Please provide a directory as the first argument"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -15,14 +26,19 @@ if [ "${2}" == "" ]; then
|
||||||
rm -f "${number}"
|
rm -f "${number}"
|
||||||
bash position.sh reset
|
bash position.sh reset
|
||||||
|
|
||||||
echo "Are you ready to continue? (yes/no)"
|
askContinue "Starting with first frame..."
|
||||||
read input
|
else
|
||||||
if [ "$input" != "n" ] && [ "$input" != "no" ]
|
c=0
|
||||||
then
|
for svg in "${1}"*.svg ; do
|
||||||
echo "Starting with first frame..."
|
if [ "${c}" != "${2}" ]; then
|
||||||
else
|
let "c=c+1"
|
||||||
exit 1
|
continue
|
||||||
fi
|
fi
|
||||||
|
filename=`basename "${svg}"`
|
||||||
|
echo "Starting frame: ${filename}"
|
||||||
|
break
|
||||||
|
done
|
||||||
|
askContinue "Continuing with frame ${filename}..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
|
@ -44,13 +60,7 @@ for svg in "${1}"*.svg ; do
|
||||||
ax "${svg}"
|
ax "${svg}"
|
||||||
rm -f "${number}"
|
rm -f "${number}"
|
||||||
bash position.sh reset
|
bash position.sh reset
|
||||||
echo "Are you ready to continue? (yes/no)"
|
|
||||||
read input
|
askContinue "Continuing with next frame..."
|
||||||
if [ "$input" != "n" ] && [ "$input" != "no" ]
|
|
||||||
then
|
|
||||||
echo "Continuing with next frame..."
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue