mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 06:32:43 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -15,7 +15,9 @@ async function readLastLogLine(filePath: string): Promise<string | null> {
|
||||
const raw = await fs.readFile(filePath, "utf8");
|
||||
const lines = raw.split(/\r?\n/).map((line) => line.trim());
|
||||
for (let i = lines.length - 1; i >= 0; i -= 1) {
|
||||
if (lines[i]) return lines[i];
|
||||
if (lines[i]) {
|
||||
return lines[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
} catch {
|
||||
@@ -32,7 +34,9 @@ export async function readLastGatewayErrorLine(env: NodeJS.ProcessEnv): Promise<
|
||||
);
|
||||
for (let i = lines.length - 1; i >= 0; i -= 1) {
|
||||
const line = lines[i];
|
||||
if (!line) continue;
|
||||
if (!line) {
|
||||
continue;
|
||||
}
|
||||
if (GATEWAY_LOG_ERROR_PATTERNS.some((pattern) => pattern.test(line))) {
|
||||
return line;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user