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

View File

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

View File

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

View File

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