fix call from outside install dir

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2019-05-31 22:33:59 +02:00
parent 4297fc164b
commit dbb6caf667
1 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ v0.90-rc1-1-g46271cc
#### $$VERSION$$ v0.90-rc1-3-g4297fc1
#
# Exit Codes:
# - 0 sucess (hopefully)
@ -44,6 +44,7 @@ if [ "${SCRIPT}" != "${REALME}" ] || [ "$1" = "source" ]; then
SOURCE="yes"
else
SCRIPT="./$(basename "${SCRIPT}")"
MODULEDIR="./$(basename "${MODULEDIR}")"
fi
if [ "$BASHBOT_HOME" != "" ]; then
@ -59,6 +60,8 @@ RUNUSER="${USER}" # USER is overwritten by bashbot array
if [ "${SOURCE}" != "yes" ] && [ "$BASHBOT_HOME" = "" ] && ! cd "${RUNDIR}" ; then
echo -e "${RED}ERROR: Can't change to ${RUNDIR} ...${NC}"
exit 1
else
RUNDIR="."
fi
if [ ! -w "." ]; then
@ -153,7 +156,6 @@ else
source "${COMMANDS}" "source"
fi
#################
# BASHBOT INTERNAL functions
# $1 URL, $2 filename in DATADIR