Skip to content

Commit f3cdfc2

Browse files
committed
fix: test for absolute url in worker
1 parent faf706f commit f3cdfc2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/runtime/loader.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { walk } from "@std/fs";
22
import { parseArgs as parse } from "@std/cli";
3-
import { basename, join, toFileUrl } from "@std/path";
3+
import { basename, join, toFileUrl, isAbsolute } from "@std/path";
44

55
const flags = parse(Deno.args, {
66
string: ["root"],
@@ -28,7 +28,9 @@ for await (const path of walk(flags.root)) {
2828

2929
const loadWorker = async () => {
3030
while (true) {
31-
const scriptUrl = toFileUrl(join(Deno.cwd(), path.path));
31+
const scriptUrl = toFileUrl(
32+
isAbsolute(path.path) ? path.path : join(Deno.cwd(), path.path)
33+
);
3234
console.info("Load script", path.path, scriptUrl.href);
3335

3436
const worker = new Worker(scriptUrl, {

0 commit comments

Comments
 (0)