Merge execute_module in init_module

This commit is contained in:
Antonin Décimo
2015-06-16 17:24:13 +02:00
parent 2c588118af
commit 16387f4f7e
5 changed files with 13 additions and 26 deletions

View File

@@ -242,11 +242,12 @@ dump_var () {
# Modules functions
# Test if module should be executed
## $1: Module name
# Init module
## $1: Pretty module name
## $2: Configuration module name
## return: 0 - if module should be executed, else exit 2
execute_module () {
local module="$1"
init_module () {
local module="$2"
read_config "$module"
module=${module^^}
if [[ ${!module} == true ]]; then
@@ -255,21 +256,15 @@ execute_module () {
gen_version $VERSION
unset VERSION
fi
MODULE="$1"
mkdir -p "$RELEASE_DIR" "$CACHE_DIR"
echo "Generating $TITLE with LÖVE $LOVE_VERSION for ${MODULE}..."
return 0
else
exit_module "execute"
fi
}
# Init module
## $1: Pretty module name
init_module () {
MODULE="$1"
mkdir -p "$RELEASE_DIR"
mkdir -p "$CACHE_DIR"
echo "Generating $TITLE with LÖVE $LOVE_VERSION for ${MODULE}..."
}
# Create the LÖVE file
## $1: Compression level 0-9
create_love_file () {
@@ -339,7 +334,7 @@ fi
(
(execute_module "love")
(init_module "LÖVE" "love")
if [[ $? -eq 0 || $DEFAULT_MODULE == true ]]; then
read_config "default"
init_module "LÖVE"

View File

@@ -1,7 +1,5 @@
# Android debug package
execute_module "android"
init_module "Android"
init_module "Android" "android"
PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')

View File

@@ -1,7 +1,5 @@
# Debian package
execute_module "debian"
init_module "Debian"
init_module "Debian" "debian"
PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')

View File

@@ -1,7 +1,5 @@
# Mac OS X
execute_module "osx"
init_module "Mac OS X"
init_module "Mac OS X" "osx"
PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')

View File

@@ -1,7 +1,5 @@
# Windows
execute_module "windows"
init_module "Windows"
init_module "Windows" "windows"
PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')