Skip to content
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

Fixed Issue 175: Command does not load dotenv files if some do not exist [1] #181

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

egasimov
Copy link

Hi, The following PR is intended to resolve issue-175 .

When the any of the passed fileNames do not exist, it just silently stops the process of 'load env files'
and start to execute the command provided.

I believe that behaviour might lead to unexpected results and assumptions which might affect the correctness of the system that utilizes the environment variables using godotenv command
And decided to make small PR.

Current behaviour:
Silently stopping the process of 'load env files' and continuing to execute the command provided.

$ cat .env
FOO="Using .env"

$ godotenv -f ".env,.env.doesnotexist" env | grep FOO
FOO=Using .env

$ godotenv -f ".env.doesnotexist,.env" env | grep FOO
# FOO does not get set

Considered behaviour:
When the fileName do not exist, then print the message "The system cannot find the file spec" and exit.

$ cat .env
FOO="Using .env"

$ godotenv -f ".env,.env.doesnotexist" env | grep FOO
FOO=Using .env

$ godotenv -f ".env.doesnotexist,.env" env | grep FOO
open .env.doesnotexist: The system cannot find the file spec

@egasimov egasimov changed the title Fixed Issue 175: Command does not load dotenv files if some do not exist Fixed Issue 175: Command does not load dotenv files if some do not exist [1] Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command does not load dotenv files if some do not exist
1 participant