-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw an error or output a warning when --env-file
can not be opened.
#50536
Comments
@anonrig can you assign this issue to me will like to work on this as my first OSS contribution |
hello there, I want to take this issue :) , and i would like to discuss an issue and some concerns I have. Specifically, I am wondering what my approach should be if the Additionally, I have another question. What if the user wants to use multiple environment files but one of them is missing? Should we provide a warning and continue the process or stop the process? Any ideas are welcome. :) cc @anonrig |
In my personal opinion, it should throw an error. This will be consistent with how the FileSystem module works, for example if you |
Seems good, I will create the PR soon for this issue |
Hi, I would like to be involved in solving this issue! (my first issue) |
Cool! Thanks for being interested in this issue, but unfortunately I am already working on this :) |
Sorry, this was my first time looking at making a contribution. mb
…On Mon, 13 Nov 2023 at 12:54 pm, Ardi Nugraha ***@***.***> wrote:
Cool! Thanks for being interested in this issue, but unfortunately I am
already working on this :)
—
Reply to this email directly, view it on GitHub
<#50536 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZPH7EEGNMZBFITFI4QUHMTYEF4XFAVCNFSM6AAAAAA64FR27KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBXGM3DEMZTGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hi, do you need some help with this? |
@virtuallyunknown |
Yep for sure. Amazing work @ardi-nugraha, hats off to you, and I think this will be beneficial to all developers in their future projects! 👏👏👏 |
Thanks @virtuallyunknown . I hope so too :) |
What is the problem this feature will solve?
Greetings! Thanks a lot for implementing
--env-file
directly into Node.I am currently using Node v20.9.0 on Linux, and if you run
node
with the--env-file
option that points to a file that can't be reached, it still will execute the program as if everything went fine. For example:What is the feature you are proposing to solve the problem?
This is not an uncommon scenario that you can find yourself in, and it can occur for various reasons. For example if you are working in a monorepository and the context of the current working directory changes, or if you lack sufficient permissions to open the file.
I think it would be beneficial for developers if an error or a warning was shown if the env file can't be opened.
What alternatives have you considered?
I have been using the dotenv package and currently in the process of migrating to native
--env-file
instead.The text was updated successfully, but these errors were encountered: