Tarrasch / zsh-autoenv

Autoenv for zsh
700 stars 30 forks source link

Change default locations of env files #32

Closed blueyed closed 9 years ago

blueyed commented 9 years ago

For #31.

While at it, I've also changed the setting name and location for the auth file.

These commits should be squashed then before merging.

blueyed commented 9 years ago

I've thought a bit about migrating existing files, but then thought it was not worth the effort probably (at the current stage / popularity of the project).

I've added the following to get warned myself about .env files that might not be sourced now anymore:

_warn_old_env() {
  if [[ -f $PWD/.env ]]; then
    echo "WARN: found .env file. Should be .autoenv.zsh probably!" >&2
  fi
}
add-zsh-hook chpwd _warn_old_env

I've also noticed that moving the existing auth file does not help much, when the name of the files itself changes (given the defaults).

Tarrasch commented 9 years ago

Hmm, maybe add that warning to this repo as well? It could be on by default but you have the option to not register the hook with a config variable. Maybe?

blueyed commented 9 years ago

A warning/note in the repo sounds good. I am not sure, if we should ship the extra chpwd hook though. You can see a list of used files in your with env file anyway.

Tarrasch commented 9 years ago

"with file"? But sure, I'm fine with not shipping the chpwd hook.

blueyed commented 9 years ago

"with file"

env file, sorry.

Tarrasch commented 9 years ago

So LGTM. :)