From 78ee0de29b46f5faed6ca2ae5222c64fbd9a2c1e Mon Sep 17 00:00:00 2001 From: sanine Date: Tue, 4 Jan 2022 23:18:10 -0600 Subject: allow overriding the builtin script --- src/lua-script/script.h | 4 ++-- src/lua-script/script.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lua-script') diff --git a/src/lua-script/script.h b/src/lua-script/script.h index 0b58f11..8f0b7cc 100644 --- a/src/lua-script/script.h +++ b/src/lua-script/script.h @@ -55,7 +55,6 @@ const char *argent_script = " error('items must specify a pubDate!')\n" " else\n" " tbl.pubDate = to_rfc822(tbl.pubDate, 'Z')\n" - " print(tbl.pubDate)\n" " end\n" "\n" " table.insert(self.items, tbl)\n" @@ -438,7 +437,8 @@ const char *argent_script = " function process_lua_file(filename, parent)\n" " local success, result = pcall(loadfile(argent.config.site_directory..parent..filename))\n" " if not success then\n" - " print('WARNING: '..result)\n" + " argent.log('error', result)\n" + " argent.log('warn', fmt('%q will not be processed for output!', parent..filename))\n" " return\n" " end\n" "\n" diff --git a/src/lua-script/script.lua b/src/lua-script/script.lua index 65bf0cf..0a6323a 100644 --- a/src/lua-script/script.lua +++ b/src/lua-script/script.lua @@ -54,7 +54,6 @@ RssChannel.addItem = function(self, tbl) error('items must specify a pubDate!') else tbl.pubDate = to_rfc822(tbl.pubDate, 'Z') - print(tbl.pubDate) end table.insert(self.items, tbl) @@ -437,7 +436,8 @@ return function(config) function process_lua_file(filename, parent) local success, result = pcall(loadfile(argent.config.site_directory..parent..filename)) if not success then - print('WARNING: '..result) + argent.log('error', result) + argent.log('warn', fmt('%q will not be processed for output!', parent..filename)) return end -- cgit v1.2.1