2014-12-02 19:49:23 +02:00
|
|
|
Test $PWD, $autoenv_event, $autoenv_from_dir and $autoenv_to_dir.
|
2014-11-16 13:05:16 +02:00
|
|
|
|
2015-04-23 17:03:21 +03:00
|
|
|
$ source $TESTDIR/setup.zsh || return 1
|
2014-11-16 13:05:16 +02:00
|
|
|
|
|
|
|
Setup env actions / output.
|
|
|
|
|
2014-11-21 23:51:28 +02:00
|
|
|
$ AUTOENV_LOOK_UPWARDS=1
|
2014-11-16 13:05:16 +02:00
|
|
|
$ mkdir -p sub/sub2
|
|
|
|
$ cd sub
|
2015-05-22 00:58:26 +03:00
|
|
|
$ echo 'echo ENTERED: PWD:${PWD:t} pwd:${${"$(pwd)"}:t} from:${autoenv_from_dir:t} to:${autoenv_to_dir:t} event:${autoenv_event}' > .autoenv.zsh
|
|
|
|
$ echo 'echo LEFT: PWD:${PWD:t} pwd:${${"$(pwd)"}:t} from:${autoenv_from_dir:t} to:${autoenv_to_dir:t} event:${autoenv_event}' > .autoenv_leave.zsh
|
2014-11-16 13:05:16 +02:00
|
|
|
|
|
|
|
Manually create auth files.
|
|
|
|
|
2014-11-22 00:07:53 +02:00
|
|
|
$ test_autoenv_auth_env_files
|
2014-11-16 13:05:16 +02:00
|
|
|
|
|
|
|
The actual tests.
|
|
|
|
|
|
|
|
$ cd .
|
2015-01-17 18:03:02 +02:00
|
|
|
ENTERED: PWD:sub pwd:sub from:sub to:sub event:enter
|
2014-11-16 13:05:16 +02:00
|
|
|
|
|
|
|
$ cd ..
|
2015-01-17 18:03:02 +02:00
|
|
|
LEFT: PWD:cwd.t pwd:cwd.t from:sub to:cwd.t event:leave
|
2014-11-16 13:05:16 +02:00
|
|
|
|
|
|
|
$ cd sub/sub2
|
2015-01-17 18:03:02 +02:00
|
|
|
ENTERED: PWD:sub2 pwd:sub2 from:cwd.t to:sub2 event:enter
|
2014-11-29 14:56:28 +02:00
|
|
|
|
|
|
|
Check that symlinked dirs get handled correctly.
|
|
|
|
|
|
|
|
$ cd ../..
|
2015-01-17 18:03:02 +02:00
|
|
|
LEFT: PWD:cwd.t pwd:cwd.t from:sub2 to:cwd.t event:leave
|
2014-11-29 14:56:28 +02:00
|
|
|
$ ln -s sub sub_linked
|
|
|
|
$ cd sub_linked
|
2015-01-17 18:03:02 +02:00
|
|
|
ENTERED: PWD:sub_linked pwd:sub_linked from:cwd.t to:sub_linked event:enter
|
2014-11-29 14:56:28 +02:00
|
|
|
$ cd sub2
|
2015-01-19 19:57:47 +02:00
|
|
|
|
|
|
|
$ cd ../..
|
|
|
|
LEFT: PWD:cwd.t pwd:cwd.t from:sub2 to:cwd.t event:leave
|
|
|
|
$ cd sub_linked/sub2
|
|
|
|
ENTERED: PWD:sub2 pwd:sub2 from:cwd.t to:sub2 event:enter
|