fix: corrected guideFolderChecks reduce
This commit is contained in:
committed by
mrugesh mohapatra
parent
1f09007b63
commit
aa47b16156
@ -75,13 +75,16 @@ const checkPath = fullPath => {
|
|||||||
return errorMsgs;
|
return errorMsgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
const guideFolderChecks = (fullPath, user) => {
|
const guideFolderChecks = (prFiles, user) => {
|
||||||
|
const prErrors = prFiles.reduce((errorsFound, { filename: fullPath }) => {
|
||||||
|
let newErrors;
|
||||||
if (/^guide\//.test(fullPath)) {
|
if (/^guide\//.test(fullPath)) {
|
||||||
const errors = checkPath(fullPath);
|
newErrors = checkPath(fullPath);
|
||||||
if (errors.length) {
|
|
||||||
return createErrorMsg(errors, user);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return newErrors ? errorsFound.concat(newErrors) : errorsFound;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return createErrorMsg(prErrors, user);
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.guideFolderChecks = guideFolderChecks;
|
exports.guideFolderChecks = guideFolderChecks;
|
||||||
|
Reference in New Issue
Block a user