summaryrefslogtreecommitdiff
path: root/src/lua-script/script.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua-script/script.lua')
-rw-r--r--src/lua-script/script.lua21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lua-script/script.lua b/src/lua-script/script.lua
index c6c2ecb..e44ece5 100644
--- a/src/lua-script/script.lua
+++ b/src/lua-script/script.lua
@@ -236,13 +236,32 @@ return function(config)
return false
end
+ function should_process(filename, parent)
+ if not string.match(filename, '%.lua$') then
+ return false
+ end
+
+ if should_ignore(filename, parent) then
+ return false
+ end
+
+ for pattern in pairs(argent.config.noprocess) do
+ if string.match(filename, pattern)
+ or string.match(parent..filename, pattern) then
+ return false
+ end
+ end
+
+ return true
+ end
+
function process_file(filename, parent)
if should_ignore(filename, parent) then
argent.log('debug', fmt('will not process file %q', parent..filename))
return
end
- if string.match(filename, '%.lua$') and not argent.config.noprocess[filename] then
+ if should_process(filename, parent) then
argent.log('debug', fmt('processing %q as lua file', parent..filename))
process_lua_file(filename, parent)
else