1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-12-22 19:00:15 +02:00
Commit Graph

35 Commits

Author SHA1 Message Date
Daniel Hahler
6d8141d290 Fix _autoenv_get_file_upwards for older Zsh 2014-11-24 20:13:18 +01:00
Daniel Hahler
d9ff71ac1d Some more refactoring, adding support for autoenv_source_parent
- use file mtime with "entered" stack
 - fix loading of varstash; look at $functions
 - Refactor stack handling, add tests
 - Refactor `_autoenv_get_file_upwards`, add tests
 - tests: setup: reset AUTOENV_ENV_FILENAME
2014-11-24 20:13:18 +01:00
Daniel Hahler
bcec00d2dd Use AUTOENV prefix
- s/DOTENV_/AUTOENV_/
 - s/dotenv_/autoenv_/

Ref: https://github.com/Tarrasch/zsh-autoenv/issues/6
2014-11-24 20:13:18 +01:00
Daniel Hahler
e088e83ff9 Cleanup 2014-11-24 20:13:18 +01:00
Daniel Hahler
dbfb8fe519 Streamline cwd behavior while sourcing 2014-11-24 20:13:18 +01:00
Daniel Hahler
67e8030770 tests: add and use test_autoenv_add_to_env and test_autoenv_auth_env_files
Conflicts:
	autoenv.zsh
2014-11-24 20:13:18 +01:00
Daniel Hahler
f31bb529de s/ENV_AUTHORIZATION_FILE/AUTOENV_ENV_FILENAME/
Ref: https://github.com/Tarrasch/zsh-autoenv/issues/6
2014-11-24 20:13:18 +01:00
Daniel Hahler
d9529636b0 Comments / doc 2014-11-24 20:13:18 +01:00
Daniel Hahler
5b553ba1ed varstash integration
Fixes: https://github.com/Tarrasch/zsh-autoenv/issues/5
2014-11-24 20:13:18 +01:00
Daniel Hahler
0bcbeb5ae5 Adopt varstash from http://github.com/cxreg/smartcd
Decouple it from smartcd and consider it zsh-only.

This also adds required library functions from smartcd's
lib/core/arrays.
2014-11-24 20:13:18 +01:00
Daniel Hahler
54124e128b Add varstash from smartcd
Source: 4fef3d3610/lib/core/varstash
2014-11-24 20:13:18 +01:00
Daniel Hahler
c12b861952 tests: inject '-t 1' to read during tests 2014-11-24 20:13:18 +01:00
Daniel Hahler
c1a25d724e tests: add setup script, used to be for all tests 2014-11-24 20:13:18 +01:00
Daniel Hahler
19d9e50650 Set DOTENV_LOOK_UPWARDS=1 by default
Change `_dotenv_hash_pair`, adding a version suffix to trigger
re-authentication.

Fixes https://github.com/Tarrasch/zsh-autoenv/issues/3
2014-11-24 20:13:17 +01:00
Daniel Hahler
9cb032a54c Makefile: add targets for tests/*.t 2014-11-24 18:05:31 +01:00
Daniel Hahler
f8a9942968 Set DOTENV_LOOK_UPWARDS=1 by default
Fixes https://github.com/Tarrasch/zsh-autoenv/issues/3
2014-11-16 12:35:17 +01:00
Daniel Hahler
b25f6b14dc Add tests for $PWD during enter and leave events 2014-11-16 12:05:16 +01:00
Daniel Hahler
e4a7de4c50 Merge pull request #4 from blueyed/improvements
A lot of improvements, based on coming from "smartcd"
2014-11-16 11:46:35 +01:00
Daniel Hahler
98f0ec81fe Use 'test' as target for tests (common sense) 2014-11-16 11:40:09 +01:00
Daniel Hahler
64bbb2f305 doc / small refactoring according to feedback 2014-11-16 11:39:10 +01:00
Daniel Hahler
71ed15679b _dotenv_source: use 'builtin cd' and stored dir instead of 'cd -' 2014-11-15 17:29:36 +01:00
Daniel Hahler
a37b0bc3f5 Wrap sourcing in _dotenv_source: chdir and set _dotenv_cwd=$PWD 2014-11-15 16:09:37 +01:00
Daniel Hahler
d114d0a0ea Check for file existence in _dotenv_check_authorized_env_file 2014-11-15 16:09:02 +01:00
Daniel Hahler
4662727a22 Cleanup, and fixes (absolute path for env_file) 2014-11-15 15:48:57 +01:00
Daniel Hahler
1d3e5b69a7 Add a test for DOTENV_HANDLE_LEAVE=0 2014-11-15 15:25:20 +01:00
Daniel Hahler
4676713bc6 Various improvements
- Support for leave event, via DOTENV_FILE_LEAVE and _dotenv_event (can
   use DOTENV_FILE_LEAVE=$DOTENV_FILE_ENTER).
 - Support for searching upwards for $DOTENV_FILE_ENTER (#3).
 - Source .env only once per session, but re-source when leave events
   are enabled (#1).
 - Trigger the machinery when the script gets sourced, for the current
   dir (#2).
2014-11-15 15:08:52 +01:00
Daniel Hahler
41625bf31c Use 'local' in functions 2014-11-15 14:49:48 +01:00
Daniel Hahler
1e60c98e4a Use escaped grep command, skipping aliases 2014-11-15 13:59:42 +01:00
Arash Rouhani
b7dfc3ec04 Add bitdeli badge 2013-09-16 11:27:08 +02:00
Arash Rouhani
cae790171d Forgot trailing white space 2013-09-08 18:54:17 +02:00
Arash Rouhani
8bed1a975e Add travis image 2013-09-08 18:50:20 +02:00
Arash Rouhani
08fec15f31 Add tests 2013-09-08 18:32:16 +02:00
Arash Rouhani
b849670591 Add readme 2013-09-08 17:14:28 +02:00
Arash Rouhani
8112af241a Antigenify 2013-09-08 17:07:38 +02:00
Arash Rouhani
fce22b3c41 Add source file 2013-09-08 17:06:26 +02:00