From b366b05f11434891b2ac443fe3edc8cf0a6b975d Mon Sep 17 00:00:00 2001 From: javalikescript Date: Sat, 6 Jul 2024 09:34:35 +0200 Subject: [PATCH] Allow to disable scripts from command line --- lha/Engine.lua | 6 +++++- lha/schema.json | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lha/Engine.lua b/lha/Engine.lua index e63c303..ac67063 100644 --- a/lha/Engine.lua +++ b/lha/Engine.lua @@ -302,7 +302,11 @@ return class.create(function(engine) function engine:loadScriptExtensions() if self.scriptsDir:isDirectory() then - self:loadExtensionsFromDirectory(self.scriptsDir, 'script') + if self.options.disableScripts then + logger:info('Script extensions disabled') + else + self:loadExtensionsFromDirectory(self.scriptsDir, 'script') + end end end diff --git a/lha/schema.json b/lha/schema.json index 31a2a86..5386592 100644 --- a/lha/schema.json +++ b/lha/schema.json @@ -68,6 +68,11 @@ "minimum": 0, "type": "integer" }, + "disableScripts": { + "default": false, + "title": "Disable the script extensions", + "type": "boolean" + }, "work": { "default": "work", "title": "The work directory",