Skip to content

Commit

Permalink
fix: test for absolute url in worker
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNoim committed May 30, 2024
1 parent faf706f commit f3cdfc2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/runtime/loader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { walk } from "@std/fs";
import { parseArgs as parse } from "@std/cli";
import { basename, join, toFileUrl } from "@std/path";
import { basename, join, toFileUrl, isAbsolute } from "@std/path";

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

const loadWorker = async () => {
while (true) {
const scriptUrl = toFileUrl(join(Deno.cwd(), path.path));
const scriptUrl = toFileUrl(
isAbsolute(path.path) ? path.path : join(Deno.cwd(), path.path)
);
console.info("Load script", path.path, scriptUrl.href);

const worker = new Worker(scriptUrl, {
Expand Down

0 comments on commit f3cdfc2

Please sign in to comment.