chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -23,14 +23,12 @@ async function readLastLogLine(filePath: string): Promise<string | null> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function readLastGatewayErrorLine(
|
||||
env: NodeJS.ProcessEnv,
|
||||
): Promise<string | null> {
|
||||
export async function readLastGatewayErrorLine(env: NodeJS.ProcessEnv): Promise<string | null> {
|
||||
const { stdoutPath, stderrPath } = resolveGatewayLogPaths(env);
|
||||
const stderrRaw = await fs.readFile(stderrPath, "utf8").catch(() => "");
|
||||
const stdoutRaw = await fs.readFile(stdoutPath, "utf8").catch(() => "");
|
||||
const lines = [...stderrRaw.split(/\r?\n/), ...stdoutRaw.split(/\r?\n/)].map(
|
||||
(line) => line.trim(),
|
||||
const lines = [...stderrRaw.split(/\r?\n/), ...stdoutRaw.split(/\r?\n/)].map((line) =>
|
||||
line.trim(),
|
||||
);
|
||||
for (let i = lines.length - 1; i >= 0; i -= 1) {
|
||||
const line = lines[i];
|
||||
@@ -39,7 +37,5 @@ export async function readLastGatewayErrorLine(
|
||||
return line;
|
||||
}
|
||||
}
|
||||
return (
|
||||
(await readLastLogLine(stderrPath)) ?? (await readLastLogLine(stdoutPath))
|
||||
);
|
||||
return (await readLastLogLine(stderrPath)) ?? (await readLastLogLine(stdoutPath));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user