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

Change default values: .env => .autoenv.zsh etc

This changes the defaults:
 - AUTOENV_FILE_ENTER:   .env       => .autoenv.zsh
 - AUTOENV_FILE_LEAVE:   .env_leave => .autoenv_leave.zsh

`.env` is usually used only for key-value pairs for environment
settings, e.g. with foreman.  We do not want to interfere with this.

This also renames the setting/variable AUTOENV_ENV_FILENAME to
AUTOENV_AUTH_FILE, and uses the [XDG
spec](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables)
for the default location.

The new default location for the auth file will be
~/.local/share/autoenv_auth.

When the old setting is used, or the previous default exists, a warning
is given with instructions.

Fixes https://github.com/Tarrasch/zsh-autoenv/issues/31.
Closes https://github.com/Tarrasch/zsh-autoenv/pull/32.
This commit is contained in:
Daniel Hahler
2015-05-21 23:58:26 +02:00
parent 631ea30440
commit e68a914487
8 changed files with 117 additions and 93 deletions

View File

@@ -21,27 +21,27 @@ Tests for _autoenv_authorize. {{{
Auth file is empty.
$ cd ../..
$ cat $AUTOENV_ENV_FILENAME
$ cat $AUTOENV_AUTH_FILE
Failed authorization should keep the auth file empty.
$ _autoenv_authorize does-not-exist
Missing file argument for _autoenv_hash_pair!
[1]
$ cat $AUTOENV_ENV_FILENAME
$ cat $AUTOENV_AUTH_FILE
Now adding some auth pair.
$ echo first > first
$ _autoenv_authorize first
$ cat $AUTOENV_ENV_FILENAME
$ cat $AUTOENV_AUTH_FILE
:/tmp/cramtests-*/_autoenv_utils.t/first:271ac93c44ac198d92e706c6d6f1d84aefcfa337:1 (glob)
And a second one.
$ echo second > second
$ _autoenv_authorize second
$ cat $AUTOENV_ENV_FILENAME
$ cat $AUTOENV_AUTH_FILE
:/tmp/cramtests-*/_autoenv_utils.t/first:271ac93c44ac198d92e706c6d6f1d84aefcfa337:1 (glob)
:/tmp/cramtests-*/_autoenv_utils.t/second:7bee8f3b184e1e141ff76efe369c3b8bfc50e64c:1 (glob)
@@ -49,7 +49,7 @@ And a third.
$ echo third > third
$ _autoenv_authorize third
$ cat $AUTOENV_ENV_FILENAME
$ cat $AUTOENV_AUTH_FILE
:/tmp/cramtests-*/_autoenv_utils.t/first:271ac93c44ac198d92e706c6d6f1d84aefcfa337:1 (glob)
:/tmp/cramtests-*/_autoenv_utils.t/second:7bee8f3b184e1e141ff76efe369c3b8bfc50e64c:1 (glob)
:/tmp/cramtests-*/_autoenv_utils.t/third:ad180453bf8a374a15df3e90a78c180230146a7c:1 (glob)
@@ -57,7 +57,7 @@ And a third.
Re-add the second one, with the same hash.
$ _autoenv_authorize second
$ cat $AUTOENV_ENV_FILENAME
$ cat $AUTOENV_AUTH_FILE
:/tmp/cramtests-*/_autoenv_utils.t/first:271ac93c44ac198d92e706c6d6f1d84aefcfa337:1 (glob)
:/tmp/cramtests-*/_autoenv_utils.t/third:ad180453bf8a374a15df3e90a78c180230146a7c:1 (glob)
:/tmp/cramtests-*/_autoenv_utils.t/second:7bee8f3b184e1e141ff76efe369c3b8bfc50e64c:1 (glob)
@@ -66,7 +66,7 @@ Re-add the first one, with a new hash.
$ echo one more line >> first
$ _autoenv_authorize first
$ cat $AUTOENV_ENV_FILENAME
$ cat $AUTOENV_AUTH_FILE
:/tmp/cramtests-*/_autoenv_utils.t/third:ad180453bf8a374a15df3e90a78c180230146a7c:1 (glob)
:/tmp/cramtests-*/_autoenv_utils.t/second:7bee8f3b184e1e141ff76efe369c3b8bfc50e64c:1 (glob)
:/tmp/cramtests-*/_autoenv_utils.t/first:65eb010197b73ddc109b7210080f97a87f53451e:1 (glob)