hyperupcall / autoenv

Directory-based environments.
MIT License
5.72k stars 261 forks source link

How to get the path of the current .env file? #83

Closed diegobernardes closed 8 years ago

diegobernardes commented 9 years ago

I'm using autoenv with gvm(golang) and there is a command that i must execute only once to create a symlink. How can i get the path of the .env file? If i get this, i can check inside the gvm if the link is created.

Nohac commented 8 years ago

+1 to this

kennethreitz commented 8 years ago

ah, interesting. What do you think that command would be called?

c960657 commented 8 years ago

With Bash, you can use $BASH_SOURCE:

echo Current .env file is ${BASH_SOURCE[0]}

Would be nice with a cleaner approach, though, e.g. exposing some vars such as $AUTOENV_CUR_FILE and $AUTOENV_CUR_DIR.

kennethreitz commented 8 years ago

$AUTOENV_CUR_FILE and $AUTOENV_CUR_DIR are now available in master!