Better sourcing of lib files

This commit is contained in:
Nathaniel Landau
2015-02-14 13:32:06 -05:00
parent d58b895240
commit dadc3632ae
13 changed files with 86 additions and 63 deletions

View File

@@ -33,12 +33,14 @@ scriptTemplateVersion="1.1.0" # Version of scriptTemplate.sh that this script is
# -----------------------------------
# If these can't be found, update the path to the file
# -----------------------------------
if [ -f "../lib/utils.sh" ]; then
source "../lib/utils.sh"
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ -f "${SCRIPTDIR}/../lib/utils.sh" ]; then
source "${SCRIPTDIR}/../lib/utils.sh"
else
echo "Please find the file util.sh and add a reference to it in this script. Exiting."
exit 1
fi
# trapCleanup Function
# -----------------------------------
# Any actions that should be taken if the script is prematurely