fix(lanes): add error handling for unreadable hook files in checkProfile
This commit is contained in:
@@ -360,7 +360,13 @@ async function checkProfile(dir) {
|
||||
continue;
|
||||
}
|
||||
if (!(fs.statSync(hookPath).mode & 0o111)) errors.push(`hook not executable: ${name}.sh`);
|
||||
const body = fs.readFileSync(hookPath, "utf8");
|
||||
let body;
|
||||
try {
|
||||
body = fs.readFileSync(hookPath, "utf8");
|
||||
} catch (err) {
|
||||
errors.push(`${name}.sh is not readable`);
|
||||
continue;
|
||||
}
|
||||
if (containsTodo(body)) errors.push(`${name}.sh still has an unresolved TODO`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user