1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2025-12-14 18:25:12 +02:00

Set varstash_dir for "leave" event (#72)

Fixes https://github.com/Tarrasch/zsh-autoenv/issues/45.
This commit is contained in:
Daniel Hahler
2017-10-18 00:31:43 +02:00
committed by GitHub
parent 3258f584ec
commit bdc6967fc9
2 changed files with 26 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
Test unstash behavior on leaving.
$ source $TESTDIR/setup.zsh || return 1
Setup test environment.
$ mkdir sub
$ echo 'echo ENTER; stash FOO=changed' >| sub/$AUTOENV_FILE_ENTER
$ echo 'echo LEAVE; unstash FOO' >| sub/$AUTOENV_FILE_LEAVE
$ test_autoenv_auth_env_files sub
$ FOO=orig
Activating the env stashes it and applies a new value.
$ cd sub
ENTER
$ echo $FOO
changed
Leaving the directory unstashes it (varstash_dir is set to prev dir).
$ cd ..
LEAVE
$ echo $FOO
orig