Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 3a8c79c

Browse files
committed
Fix console error statck output
1 parent b225187 commit 3a8c79c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cli.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,18 @@ async function pipe(reader: Deno.Reader, writer: Deno.Writer) {
217217
}
218218
}
219219

220+
const regStackLoc = /(http:\/\/localhost:60\d{2}\/.+)(:\d+:\d+)/;
221+
220222
function fixLine(line: string): string | null {
221223
const l = stripColor(line);
222224
if (l.startsWith(`Download http://localhost:`)) {
223225
return null;
224226
}
227+
const ret = l.match(regStackLoc);
228+
if (ret) {
229+
const url = new URL(ret[1]);
230+
return l.replace(ret[0], `.${url.pathname}${ret[2]}`);
231+
}
225232
return line;
226233
}
227234

0 commit comments

Comments
 (0)