Include scripts/love.sh into main script

This commit is contained in:
Antonin Décimo
2015-06-13 14:16:02 +02:00
parent ea90092ead
commit 9830124a31
2 changed files with 17 additions and 8 deletions

View File

@@ -251,6 +251,13 @@ execute_module ()
local module="$1" local module="$1"
read_config "$module" read_config "$module"
module=${module^^} module=${module^^}
if [[ ${!module} == true && -z $DEFAULT_MODULE ]]; then
if [[ ${module} == "LOVE" ]]; then
DEFAULT_MODULE=true
else
DEFAULT_MODULE=false
fi
fi
echo "${!module}" echo "${!module}"
} }
@@ -302,6 +309,8 @@ gen_version $LOVE_WEB_VERSION
INSTALLED=false INSTALLED=false
EMBEDDED=false EMBEDDED=false
DEFAULT_MODULE=
if [[ $INSTALLED == false && $EMBEDDED == false ]]; then if [[ $INSTALLED == false && $EMBEDDED == false ]]; then
>&2 echo "love-release has not been installed, and is not embedded into one script. Consider doing one of the two." >&2 echo "love-release has not been installed, and is not embedded into one script. Consider doing one of the two."
INSTALLED=true INSTALLED=true
@@ -313,9 +322,16 @@ elif [[ $INSTALLED == true ]]; then
SCRIPTS_DIR="scripts" SCRIPTS_DIR="scripts"
for file in "$SCRIPTS_DIR"/*.sh; do for file in "$SCRIPTS_DIR"/*.sh; do
MODULE="$(basename -s '.sh' "$file")" MODULE="$(basename -s '.sh' "$file")"
if [[ $(execute_module "$1") == true ]]; then if [[ $(execute_module "$MODULE") == true ]]; then
source "$file" source "$file"
fi fi
done done
fi fi
if [[ -z $DEFAULT_MODULE || $DEFAULT_MODULE == true ]]; then
MODULE="love"
init_module
create_love_file 9
exit_module
fi

View File

@@ -1,7 +0,0 @@
# Love
init_module "Love"
create_love_file 9
exit_module