aboutsummaryrefslogtreecommitdiffstats
path: root/make-feed.lua
diff options
context:
space:
mode:
Diffstat (limited to 'make-feed.lua')
-rwxr-xr-xmake-feed.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/make-feed.lua b/make-feed.lua
index 554d61e..17c06c2 100755
--- a/make-feed.lua
+++ b/make-feed.lua
@@ -114,6 +114,17 @@ end
local function run_file(file, extension)
local runner
+ local old_require = require
+ _G.require = function(obj)
+ local got, lib = pcall(old_require, obj)
+ if got then
+ return lib
+ else
+ err(file .. " tried to require " .. obj .. " but couldn't. skipping and hoping it won't matter.")
+ return {} --Some default value, hopefully it should be fine with it
+ end
+ end
+
if extension == "moon" then
runner = moonscript.loadfile(file)
else
@@ -121,6 +132,7 @@ local function run_file(file, extension)
end
local worked, out = pcall(runner)
if not worked then err("error when loading "..file..": ".. out) end
+ _G.require = old_require
end
local function get_macro_metadata(file)