fix(init): must use urls for asset copying (#2946)

Second attempt to fix https://github.com/denoland/fresh/pull/2943 .
Turns out that `import.meta.dirname` is `undefined` when served from
JSR. I'm not able to reproduce that error locally though.

Fixes https://github.com/denoland/fresh/pull/2943
This commit is contained in:
Marvin Hagemeister
2025-05-14 22:59:02 +02:00
committed by GitHub
parent 74d5c0f98f
commit 1957fd0ff6
+1 -1
View File
@@ -395,7 +395,7 @@ ${GRADIENT_CSS}`;
await writeFile(
"static/favicon.ico",
await Deno.readFile(
path.join(import.meta.dirname!, "assets", "favicon.ico"),
new URL(import.meta.resolve("./assets/favicon.ico")),
),
);