Skip to content

Environment file option matches on substring (--env-file) #55118

Description

@kristianthorsen

Version

v20.11.1

Platform

Darwin M-02572 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:53:05 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T8112 arm6

Subsystem

No response

What steps will reproduce the bug?

Run this version of node.
Try to run a given .js file with "node index.js --env-file-path" or any --env-file[suffix]

It will throw the following error: not found

image

How often does it reproduce? Is there a required condition?

Every time

What is the expected behavior? Why is that the expected behavior?

I expect to only be implicated by the --env-file flag when passing the exact option.

I expect to be able to create my own logic around parsing the option for instance --env-file-path.

What do you see instead?

Instead it gives me this not found error.

image

I am aware that this can be easily worked around, but getting the error randomly took some time to debug.

Additional information

This is not urgent but thought it might be nice to instead match on the entire string "--env-file" rather than all arguments that starts with it being implicated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions