From 4f6575a9879cc078d86b90deeea3d239e99eb37c Mon Sep 17 00:00:00 2001 From: Aaron Suen Date: Fri, 10 Sep 2021 08:08:00 -0400 Subject: [PATCH] Try to debug JSON parsing failure --- .cdbrelease.template.lua | 5 ++--- gitlua.js | 9 +++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.cdbrelease.template.lua b/.cdbrelease.template.lua index 9640773..eb7010d 100644 --- a/.cdbrelease.template.lua +++ b/.cdbrelease.template.lua @@ -1,4 +1,3 @@ - -- luacheck: push -- luacheck: globals config readtext readbinary @@ -11,7 +10,7 @@ return { type = "", title = "", short_description = "", - tags= {}, + tags = {}, content_warnings = {}, license = "MIT", media_license = "MIT", @@ -24,4 +23,4 @@ return { screenshots = {readbinary("screenshot.png")} } --- luacheck: pop \ No newline at end of file +-- luacheck: pop diff --git a/gitlua.js b/gitlua.js index f9e88ef..d1bbe64 100644 --- a/gitlua.js +++ b/gitlua.js @@ -41,6 +41,11 @@ module.exports = async cwd => { hook.stdin.end(); await hook.promise; - const spec = JSON.parse(buff); - config.set('gitlua', spec); + try { + const spec = JSON.parse(buff); + config.set('gitlua', spec); + } catch (err) { + console.log('Raw JSON: ' + buff); + throw err; + } };