Add a script for common functions

This commit is contained in:
Matt McWilliams 2021-09-16 11:05:07 -04:00
parent bd72e29c05
commit 911d6e2108
2 changed files with 13 additions and 10 deletions

12
common.sh Normal file
View File

@ -0,0 +1,12 @@
#!/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
}

11
draw.sh
View File

@ -8,16 +8,7 @@
# #
########################### ###########################
askContinue () { source ./common.sh
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"