Fixes https://github.com/Tarrasch/zsh-autoenv/issues/76.
$ echo first > first
$ _autoenv_authorize first
$ cat $AUTOENV_AUTH_FILE
- :/tmp/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
And a second one.
$ echo second > second
$ _autoenv_authorize second
$ cat $AUTOENV_AUTH_FILE
- :/tmp/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
- :/tmp/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
And a third.
$ echo third > third
$ _autoenv_authorize third
$ cat $AUTOENV_AUTH_FILE
- :/tmp/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
- :/tmp/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
- :/tmp/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
Re-add the second one, with the same hash.
$ _autoenv_authorize second
$ cat $AUTOENV_AUTH_FILE
- :/tmp/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
- :/tmp/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
- :/tmp/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/first:2715464726.6:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
Re-add the first one, with a new hash.
$ echo one more line >> first
$ _autoenv_authorize first
$ cat $AUTOENV_AUTH_FILE
- :/tmp/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
- :/tmp/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
- :/tmp/cramtests-*/_autoenv_utils.t/first:3620404822.20:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/third:451243482.6:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/second:594940475.7:2 (glob)
+ :/*/cramtests-*/_autoenv_utils.t/first:3620404822.20:2 (glob)
}}}
$ _autoenv_ask_for_yes() { echo "yes" }
$ cd .
Attempting to load unauthorized env file!
- -* /tmp/cramtests-*/autoenv.t/.autoenv.zsh (glob)
+ -* /*/cramtests-*/autoenv.t/.autoenv.zsh (glob)
**********************************************
$ test_autoenv_add_to_env $PWD/.autoenv.zsh mischief
$ cd .
Attempting to load unauthorized env file!
- -* /tmp/cramtests-*/autoenv.t/.autoenv.zsh (glob)
+ -* /*/cramtests-*/autoenv.t/.autoenv.zsh (glob)
**********************************************
$ _autoenv_ask_for_yes() { echo "no"; return 1 }
$ cd .
Attempting to load unauthorized env file!
- -* /tmp/cramtests-*/autoenv.t/.autoenv.zsh (glob)
+ -* /*/cramtests-*/autoenv.t/.autoenv.zsh (glob)
**********************************************
$ _autoenv_ask_for_yes() { echo "yes"; return 0 }
$ cd .
Attempting to load unauthorized env file!
- -* /tmp/cramtests-*/autoenv.t/.autoenv.zsh (glob)
+ -* /*/cramtests-*/autoenv.t/.autoenv.zsh (glob)
**********************************************
$ _autoenv_ask_for_yes() { echo "yes"; return 0 }
$ cd .
Attempting to load unauthorized env file!
- -* /tmp/cramtests-*/leave.t/sub/.autoenv.zsh (glob)
+ -* /*/cramtests-*/leave.t/sub/.autoenv.zsh (glob)
**********************************************
$ _autoenv_ask_for_yes() { echo "no"; return 1 }
$ cd ..
Attempting to load unauthorized env file!
- -* /tmp/cramtests-*/leave.t/sub/.autoenv_leave.zsh (glob)
+ -* /*/cramtests-*/leave.t/sub/.autoenv_leave.zsh (glob)
**********************************************
$ _autoenv_ask_for_yes() { echo "yes"; return 0 }
$ cd ..
Attempting to load unauthorized env file!
- -* /tmp/cramtests-*/leave.t/sub/.autoenv_leave.zsh (glob)
+ -* /*/cramtests-*/leave.t/sub/.autoenv_leave.zsh (glob)
**********************************************
$ cd sub
autoenv_source_parent_from_sub:
Attempting to load unauthorized env file!
- -* /tmp/cramtests-*/recurse-upwards.t/.autoenv.zsh (glob)
+ -* /*/cramtests-*/recurse-upwards.t/.autoenv.zsh (glob)
**********************************************
$ cd .
autoenv_source_parent_from_sub:
Attempting to load unauthorized env file!
- -* /tmp/cramtests-*/recurse-upwards.t/.autoenv.zsh (glob)
+ -* /*/cramtests-*/recurse-upwards.t/.autoenv.zsh (glob)
**********************************************
export AUTOENV_AUTH_FILE="$CRAMTMP/autoenv/.autoenv_auth"
-if [[ $AUTOENV_AUTH_FILE[0,4] != '/tmp' ]]; then
- echo "AUTOENV_AUTH_FILE is not in /tmp. Aborting."
- return 1
-fi
-
# Abort this setup script on any error.
_save_errexit=${options[errexit]}
set -e
de-authenticating the old hash.
$ cat $AUTOENV_AUTH_FILE
- :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:3679467995.13:2 (glob)
+ :/*/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:3679467995.13:2 (glob)
Re-create auth file with v1 hashes for both auth files.
$ cd ..
LEAVE
$ cat $AUTOENV_AUTH_FILE
- :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:4c403f1870af2ab5472370a42b6b2b488cefe83c:1 (glob)
- :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv_leave.zsh:803077150.11:2 (glob)
+ :/*/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:4c403f1870af2ab5472370a42b6b2b488cefe83c:1 (glob)
+ :/*/cramtests-*/upgrade_hash.t/sub/.autoenv_leave.zsh:803077150.11:2 (glob)
The enter file's hash should get updated.
$ cd sub
ENTERED
$ cat $AUTOENV_AUTH_FILE
- :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv_leave.zsh:803077150.11:2 (glob)
- :/tmp/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:3679467995.13:2 (glob)
+ :/*/cramtests-*/upgrade_hash.t/sub/.autoenv_leave.zsh:803077150.11:2 (glob)
+ :/*/cramtests-*/upgrade_hash.t/sub/.autoenv.zsh:3679467995.13:2 (glob)