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

Ignore directory .env, keep searching #71

Merged
merged 1 commit into from
Feb 2, 2016
Merged

Ignore directory .env, keep searching #71

merged 1 commit into from
Feb 2, 2016

Conversation

joneskoo
Copy link
Contributor

Without this, autoenv thinks a directory is a file and
asks to allow executing it. Autoenv only works for
regular files.

URL: http://www.gnu.org/software/bash/manual/html_node/Bash-Conditional-Expressions.html

Without this, autoenv thinks a directory is a file and
asks to allow executing it. Autoenv only works for
regular files.

URL: http://www.gnu.org/software/bash/manual/html_node/Bash-Conditional-Expressions.html
@joneskoo
Copy link
Contributor Author

@flebel I'm not sure about that. I prefer actually getting an error if .env turned unreadable.

If .env is a directory, I think it makes sense to ignore it as it, duh, isn't an env-file. When the permissions don't allow reading it, I think including a parent .env file instead without error could be confusing. In that case it's better to be explicit and show that there was a permissions issue. Besides if permissions were later changed, a different env-file would be found. After my pull request, with unreadable file:

grant:~ joneskoo $ cd test
shasum: /Users/joneskoo/test/.env: 
-bash: /Users/joneskoo/test/.env: Permission denied

I think this is reasonable.

If .env is a directory, it is silently ignored and the parent directory is searched for an env-file recursively like the .env directory didn't exist.

@joneskoo joneskoo changed the title Require env file to be a regular file Ignore directory .env, keep searching Nov 17, 2014
@dasJ
Copy link
Contributor

dasJ commented May 29, 2015

+1

kennethreitz added a commit that referenced this pull request Feb 2, 2016
Ignore directory .env, keep searching
@kennethreitz kennethreitz merged commit cdaceb4 into hyperupcall:master Feb 2, 2016
@kennethreitz
Copy link
Contributor

✨ 🍰 ✨

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.

None yet

3 participants