Improves modules sourcing

A module should always begin with a test to `execute_module` to see if
it should be executed. As modules are always sourced
(even when embedded), a simple `return` will stop the subscript.

Modules are executed in a subscript, so the global space will not be
polluted, and will also be reset after the execution of the module.

This commit also solves some bugs in Makefile and lua parser.
This commit is contained in:
Antonin Décimo
2015-06-14 18:17:43 +02:00
parent 06d5369877
commit 72ada933f1
7 changed files with 60 additions and 23 deletions

View File

@@ -1,4 +1,8 @@
# Android debug package
if [[ $(execute_module "android") == false ]]; then
return
fi
init_module "Android"

View File

@@ -1,4 +1,8 @@
# Debian package
if [[ $(execute_module "debian") == false ]]; then
return
fi
init_module "Debian"

View File

@@ -1,4 +1,5 @@
# Example
return
# This example script should show you how to write a module for love-release.

View File

@@ -1,4 +1,8 @@
# Mac OS X
if [[ $(execute_module "osx") == false ]]; then
return
fi
init_module "Mac OS X"

View File

@@ -1,4 +1,8 @@
# Windows
if [[ $(execute_module "windows") == false ]]; then
return
fi
init_module "Windows"