fix: corrected guideFolderChecks reduce

This commit is contained in:
Randell Dawson
2018-11-09 20:17:45 -08:00
committed by mrugesh mohapatra
parent 1f09007b63
commit aa47b16156

View File

@ -75,13 +75,16 @@ const checkPath = fullPath => {
return errorMsgs; return errorMsgs;
}; };
const guideFolderChecks = (fullPath, user) => { const guideFolderChecks = (prFiles, user) => {
if (/^guide\//.test(fullPath)) { const prErrors = prFiles.reduce((errorsFound, { filename: fullPath }) => {
const errors = checkPath(fullPath); let newErrors;
if (errors.length) { if (/^guide\//.test(fullPath)) {
return createErrorMsg(errors, user); newErrors = checkPath(fullPath);
} }
} return newErrors ? errorsFound.concat(newErrors) : errorsFound;
}, []);
return createErrorMsg(prErrors, user);
}; };
exports.guideFolderChecks = guideFolderChecks; exports.guideFolderChecks = guideFolderChecks;