summaryrefslogtreecommitdiff
path: root/scripts/toy.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/toy.groovy')
-rw-r--r--scripts/toy.groovy16
1 files changed, 14 insertions, 2 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy
index 3a0d15a..1d8aa03 100644
--- a/scripts/toy.groovy
+++ b/scripts/toy.groovy
@@ -60,14 +60,26 @@ return new Object() {
.sum()
};
def loadModules = { toy ->
+ final postLoad = [:];
new File("$DATAFOLDER/scripts/toy")
.listFiles()
.each({s ->
if (stateIs("DEBUG")) {
- show("Loading $s...");
+ show("Loading ${s.name}...");
}
- Eval.me(s.text)(toy);
+ postLoad[s.name] = Eval.me(s.text)(toy);
});
+ postLoad
+ .findAll { s, p -> p }
+ .each { s, p ->
+ if (stateIs("DEBUG")) {
+ show("Post load $s...");
+ }
+ p();
+ };
+ if (stateIs("DEBUG")) {
+ show("All modules loaded");
+ }
};
// Utils