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
|
|
|
|
2014-11-21 21:07:06 +02:00
|
|
|
$ source $TESTDIR/setup.sh
|
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-01-17 18:03:02 +02:00
|
|
|
$ echo 'echo ENTERED: PWD:${PWD:t} pwd:${${"$(pwd)"}:t} from:${autoenv_from_dir:t} to:${autoenv_to_dir:t} event:${autoenv_event}' > .env
|
|
|
|
$ echo 'echo LEFT: PWD:${PWD:t} pwd:${${"$(pwd)"}:t} from:${autoenv_from_dir:t} to:${autoenv_to_dir:t} event:${autoenv_event}' > .env.leave
|
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-17 18:03:02 +02:00
|
|
|
ENTERED: PWD:sub2 pwd:sub2 from:sub_linked to:sub2 event:enter
|
2014-11-29 14:56:28 +02:00
|
|
|
$ cd .
|