handle case where there is no github repo

This commit is contained in:
Fienny Angelina 2018-09-25 20:11:30 +08:00
parent c0cc79f995
commit a76a887901

View file

@ -68,6 +68,8 @@ module.exports = async function processMetadata(
| grep -I "^author " | sort | uniq -c | sort -nr; \ | grep -I "^author " | sort | uniq -c | sort -nr; \
` `
).toString().split('\n'); ).toString().split('\n');
/* handle case where it's not github repo */
if (results.length && results[0].length) {
let authorData; let authorData;
const authors = []; const authors = [];
let totalLineCount = 0; let totalLineCount = 0;
@ -86,6 +88,7 @@ module.exports = async function processMetadata(
metadata.authors = authors; metadata.authors = authors;
metadata.totalLineCount = totalLineCount; metadata.totalLineCount = totalLineCount;
}
/* language */ /* language */
const language = getLanguage(filepath, refDir, env); const language = getLanguage(filepath, refDir, env);