mirror of
https://github.com/Tarrasch/zsh-autoenv.git
synced 2025-12-14 02:15:11 +02:00
Streamline cwd behavior while sourcing
This commit is contained in:
12
tests/cwd.t
12
tests/cwd.t
@@ -1,4 +1,4 @@
|
||||
Test $PWD and $_dotenv_cwd.
|
||||
Test $PWD, $_dotenv_from_dir and _dotenv_to_dir.
|
||||
|
||||
$ source $TESTDIR/setup.sh
|
||||
|
||||
@@ -7,8 +7,8 @@ Setup env actions / output.
|
||||
$ DOTENV_LOOK_UPWARDS=1
|
||||
$ mkdir -p sub/sub2
|
||||
$ cd sub
|
||||
$ echo 'echo ENTERED: cwd:${PWD:t} ${_dotenv_cwd:t}' >> .env
|
||||
$ echo 'echo LEFT: cwd:${PWD:t} ${_dotenv_cwd:t}' >> .env.leave
|
||||
$ echo 'echo ENTERED: PWD:${PWD:t} from:${_dotenv_from_dir:t} to:${_dotenv_to_dir:t}' > .env
|
||||
$ echo 'echo LEFT: PWD:${PWD:t} from:${_dotenv_from_dir:t} to:${_dotenv_to_dir:t}' > .env.leave
|
||||
|
||||
Manually create auth files.
|
||||
|
||||
@@ -17,10 +17,10 @@ Manually create auth files.
|
||||
The actual tests.
|
||||
|
||||
$ cd .
|
||||
ENTERED: cwd:sub sub
|
||||
ENTERED: PWD:sub from:sub to:sub
|
||||
|
||||
$ cd ..
|
||||
LEFT: cwd:sub cwd.t
|
||||
LEFT: PWD:sub from:sub to:cwd.t
|
||||
|
||||
$ cd sub/sub2
|
||||
ENTERED: cwd:sub sub2
|
||||
ENTERED: PWD:sub2 from:cwd.t to:sub2
|
||||
|
||||
Reference in New Issue
Block a user