Tarrasch / zsh-autoenv

Autoenv for zsh
700 stars 30 forks source link

How to set path at locality of .autoenv.zsh? #92

Closed sedlund closed 5 years ago

sedlund commented 6 years ago

Hello,

I have /home/user/src/ansible/myProject/.autoenv.zsh that looks like this:

echo Setting environment variables... autostash ANSIBLE_CONFIG=${PWD}/ansible.cfg

I want ${PWD} to be the path where the .autoenv.zsh is at in the tree.

If I cd deeper into the tree such as /home/user/src/ansible/myProject/roles/myrole/tasks I still want ANSIBLE_CONFIG to be /home/user/src/ansible/myProject/ansible.cfg not: /home/user/src/ansible/myProject/roles/myrole/tasks/ansible.cfg

Thanks!

sedlund commented 6 years ago

I enabled debugging, and found the ${varstash_dir} variable. I've changed to use: autostash ANSIBLE_CONFIG=${varstash_dir}/ansible.cfg

This seems to do what I want.