From 16387f4f7ec29b8681e62ac27ecf2b119f926403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Tue, 16 Jun 2015 17:24:13 +0200 Subject: [PATCH] Merge execute_module in init_module --- love-release.sh | 23 +++++++++-------------- scripts/android.sh | 4 +--- scripts/debian.sh | 4 +--- scripts/macosx.sh | 4 +--- scripts/windows.sh | 4 +--- 5 files changed, 13 insertions(+), 26 deletions(-) diff --git a/love-release.sh b/love-release.sh index 8d12dc5..7c9d9cd 100755 --- a/love-release.sh +++ b/love-release.sh @@ -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" diff --git a/scripts/android.sh b/scripts/android.sh index 7ea3a7b..cb78fa4 100644 --- a/scripts/android.sh +++ b/scripts/android.sh @@ -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:]') diff --git a/scripts/debian.sh b/scripts/debian.sh index a138a7e..93958df 100644 --- a/scripts/debian.sh +++ b/scripts/debian.sh @@ -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:]') diff --git a/scripts/macosx.sh b/scripts/macosx.sh index cbc7c10..6991eaa 100644 --- a/scripts/macosx.sh +++ b/scripts/macosx.sh @@ -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:]') diff --git a/scripts/windows.sh b/scripts/windows.sh index 12a28f9..bfe690b 100644 --- a/scripts/windows.sh +++ b/scripts/windows.sh @@ -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:]')