Skip to content

Commit 0504815

Browse files
Apply prepare changes
1 parent 078b044 commit 0504815

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

app/utils/local/scripts.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function waitForReady(child, expectedResponse, signal) {
2626
let recentOutput = "";
2727
function recordOutput(line) {
2828
recentOutput = (recentOutput + line + "\n").slice(-MAX_ERROR_BUFFER_BYTES);
29-
};
29+
}
3030

3131
function cleanup() {
3232
readlineStdout.removeAllListeners();
@@ -35,8 +35,10 @@ function waitForReady(child, expectedResponse, signal) {
3535
readlineStderr.close();
3636
child.removeListener("error", onError);
3737
child.removeListener("close", onClose);
38-
if (signal) { signal.removeEventListener("abort", onAbort); }
39-
};
38+
if (signal) {
39+
signal.removeEventListener("abort", onAbort);
40+
}
41+
}
4042

4143
const onLine = (line) => {
4244
console.log(`[${child.name}] ${line}`);
@@ -50,35 +52,37 @@ function waitForReady(child, expectedResponse, signal) {
5052
function onErrLine(line) {
5153
console.log(`[${child.name}] ${line}`);
5254
recordOutput(line);
53-
};
55+
}
5456

5557
function onError(err) {
5658
cleanup();
5759
reject(err);
58-
};
60+
}
5961

6062
function onClose(code) {
6163
console.log(`[${child.name}] exited with code ${code}`);
6264
cleanup();
6365
reject(
6466
new Error(
6567
`[${child.name}] exited with code ${code} before becoming ready.` +
66-
(recentOutput ? `\nRecent output:\n${recentOutput}` : ""),
68+
(recentOutput ? `\nRecent output:\n${recentOutput}` : ""),
6769
),
6870
);
69-
};
71+
}
7072

7173
function onAbort() {
7274
cleanup();
7375
reject(new Error(`[${child.name}] timed out waiting for "${expectedResponse}"`));
74-
};
76+
}
7577

7678
readlineStdout.on("line", onLine);
7779
readlineStderr.on("line", onErrLine);
7880
child.once("error", onError);
7981
child.once("close", onClose);
80-
if (signal) { signal.addEventListener("abort", onAbort, { once: true }); }
81-
})
82+
if (signal) {
83+
signal.addEventListener("abort", onAbort, { once: true });
84+
}
85+
});
8286
}
8387

8488
async function waitNuxt(nuxtProcess) {

0 commit comments

Comments
 (0)