From 6e61779e90f25745232f796ab24f81177cad8cc2 Mon Sep 17 00:00:00 2001 From: Oliver Bucher <7040739+Level8Broccoli@users.noreply.github.com> Date: Wed, 3 Aug 2022 11:24:08 +0200 Subject: [PATCH] Fix join Deno.cwd() twice --- mod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod.ts b/mod.ts index 8719713..06e4cce 100644 --- a/mod.ts +++ b/mod.ts @@ -40,7 +40,7 @@ export function config({ encoding = "utf-8", }: Config = {}) { const encoder = new TextDecoder(encoding); - const env = Deno.readFileSync(join(Deno.cwd(), path)); + const env = Deno.readFileSync(path.startsWith(Deno.cwd()) ? path : join(Deno.cwd(), path)); const entrie = encoder.decode(env); for (const [key, value] of Object.entries(parse(entrie))) {