Ensuring that functions are either sources locally or globally, but not both.

This commit is contained in:
Daniel Baumann 2012-12-04 12:47:40 +01:00
parent f145e20565
commit ffa9706fc9
1 changed files with 11 additions and 4 deletions

View File

@ -6,11 +6,18 @@ then
export LIVE_BUILD export LIVE_BUILD
fi fi
# Source global functions for _DIRECTORY in "${LIVE_BUILD}/functions" /usr/share/live/build/functions
for FUNCTION in "${LIVE_BUILD}"/functions/*.sh /usr/share/live/build/functions/*.sh
do do
if [ -e "${FUNCTION}" ] if [ -e "${_DIRECTORY}" ]
then then
. "${FUNCTION}" for _FILE in "${_DIRECTORY}"/*.sh
do
if [ -e "${_FILE}" ]
then
. "${_FILE}"
fi
done
break
fi fi
done done