From 9863a807f8aad465068edaa292d183a438cf29a8 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Tue, 23 Nov 2021 09:45:56 +0100 Subject: [PATCH] Fix CI build for authors without email. --- scripts/build.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index 3fd62a30dd..3f6ad66afa 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -22,10 +22,17 @@ handlebars.registerHelper('getAuthors', function (Authors) { return Authors.split(',').map(author => { const [_, name, link] = author.trim().match(/^([^<]+)]+)?>?$/) || [] let type = 'url' - if (link.match(/^[^@]+@[^@]+$/)) { - type = 'email' + if (link === undefined) { + type = 'github' + } else { + if (link.match(/^[^@]+@[^@]+$/)) { + type = 'email' + } } - const authorLink = type === 'email' ? 'mailto:' + link : link + + const authorLink = type === 'email' ? 'mailto:' + link + : (type === 'github' ? 'https://github.com/' + name + : link) const authorName = name.trim() return ' ' + '' + authorName + ''