Commit 5b851a63 authored by Luiza Wille's avatar Luiza Wille

Issue #69: checking if the file 'config.sh' exists before trying to use it.

Signed-off-by: Luiza Wille's avatarLuiza Wille <lmwc14@inf.ufpr.br>
parent 5c4f1aa8
......@@ -49,7 +49,12 @@
month="0$month"
fi
source ./config.sh
if [ -e config.sh ]; then
source ./config.sh
else
echo " The file 'config.sh' does not exist in this directory, exiting program."
exit
fi
# Check if all variables in config file are set:
configFile='scripts/expenses/config.sh'
......
......@@ -48,7 +48,12 @@ if [[ "${#month}" -eq "1" ]]; then
month="0$month"
fi
source ./config.sh
if [ -e config.sh ]; then
source ./config.sh
else
echo " The file 'config.sh' does not exist in this directory, exiting program."
exit
fi
# Check if all variables in config file are set:
configFile='scripts/travel_allowance/config.sh'
......
......@@ -52,7 +52,12 @@ if [[ "${#month}" -eq "1" ]]; then
month="0$month"
fi
source ./config.sh
if [ -e config.sh ]; then
source ./config.sh
else
echo " The file 'config.sh' does not exist in this directory, exiting program."
exit
fi
configFile='scripts/workers/config.sh'
if [ -z "${index}" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment