Skip to content

Bug: doubleing the path #1

Description

@viztastic

Thanks for the library @buttercubz , suiper helpful.

I think I discovered a bug. When I use env.config() I get the following error:

image

I think the issue is in line 43 of mod.ts

  const env = Deno.readFileSync(join(Deno.cwd(), path));

The issue is that the path = defaultPath and default Path looks like this:

const defaultPath = join(Deno.cwd(), ".env");

So basically it's joining Deno.cwd() twice...

maybe if we replace line 43 with:

path === defaultPath ? defaultPath : join(Deno.cwd(),path)

what do you think?

Happy to submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions