]> Sergey Matveev's repositories - zsh-autoenv.git/log
zsh-autoenv.git
9 years agoDo not reset the stack variables when (re)sourcing the plugin
Daniel Hahler [Sun, 15 Mar 2015 21:10:50 +0000 (22:10 +0100)]
Do not reset the stack variables when (re)sourcing the plugin

This is meant to keep the current state when re-sourcing the shell
config (`. ~/.zshrc`).

Closes https://github.com/Tarrasch/zsh-autoenv/pull/24

9 years agoMerge pull request #25 from blueyed/set-errexit-during-setup
Arash Rouhani [Sun, 29 Mar 2015 10:46:43 +0000 (12:46 +0200)]
Merge pull request #25 from blueyed/set-errexit-during-setup

tests: setopt errexit during setup

9 years agotests: setopt errexit during setup
Daniel Hahler [Sun, 15 Mar 2015 21:16:12 +0000 (22:16 +0100)]
tests: setopt errexit during setup

This is meant to prevent accidentally overwriting your auth file when
running / changing the tests.

9 years agoAdd zgen instructions
Joe Block [Wed, 18 Feb 2015 15:30:43 +0000 (07:30 -0800)]
Add zgen instructions

9 years agoMerge pull request #22 from Tarrasch/improve-and-test-zstat-integration
Daniel Hahler [Mon, 26 Jan 2015 13:08:25 +0000 (14:08 +0100)]
Merge pull request #22 from Tarrasch/improve-and-test-zstat-integration

Improve and test zstat integration

9 years agoMakefile: add clean target
Daniel Hahler [Sun, 25 Jan 2015 22:51:41 +0000 (23:51 +0100)]
Makefile: add clean target

9 years agotests: setup.sh: doc / more verbose
Daniel Hahler [Sun, 25 Jan 2015 18:50:27 +0000 (19:50 +0100)]
tests: setup.sh: doc / more verbose

9 years agotests: abort if setup fails!
Daniel Hahler [Sun, 25 Jan 2015 18:48:25 +0000 (19:48 +0100)]
tests: abort if setup fails!

Otherwise the user's auth file might get removed.

9 years agoTest env for invalid zsh module_path, where zsh/zstat fails
Daniel Hahler [Sun, 25 Jan 2015 18:19:11 +0000 (19:19 +0100)]
Test env for invalid zsh module_path, where zsh/zstat fails

9 years agoImprove zsh/zstat integration; also make it handle dirs
Daniel Hahler [Sun, 25 Jan 2015 18:18:25 +0000 (19:18 +0100)]
Improve zsh/zstat integration; also make it handle dirs

9 years agoImprove ZDOTDIR setting in Makefile
Daniel Hahler [Sun, 25 Jan 2015 18:16:30 +0000 (19:16 +0100)]
Improve ZDOTDIR setting in Makefile

9 years agoMerge branch 'allow-disable'
Daniel Hahler [Tue, 20 Jan 2015 10:16:37 +0000 (11:16 +0100)]
Merge branch 'allow-disable'

Closes: #20
9 years agoAdd support for $AUTOENV_DISABLED, which skips the chpwd hook
Daniel Hahler [Mon, 19 Jan 2015 18:01:20 +0000 (19:01 +0100)]
Add support for $AUTOENV_DISABLED, which skips the chpwd hook

9 years agoMerge pull request #19 from Tarrasch/fix-symlink-handling
Daniel Hahler [Tue, 20 Jan 2015 07:58:56 +0000 (08:58 +0100)]
Merge pull request #19 from Tarrasch/fix-symlink-handling

Fix symlink handling

9 years agoFix symlink handling, especially for symlinks not below "env_dir"
Daniel Hahler [Mon, 19 Jan 2015 17:57:47 +0000 (18:57 +0100)]
Fix symlink handling, especially for symlinks not below "env_dir"

9 years agomake: fix calling tests files directly
Daniel Hahler [Mon, 19 Jan 2015 17:54:41 +0000 (18:54 +0100)]
make: fix calling tests files directly

9 years agoMerge pull request #18 from qur2/master
Arash Rouhani [Mon, 19 Jan 2015 14:49:47 +0000 (15:49 +0100)]
Merge pull request #18 from qur2/master

Create init.zsh to make it compatible with prezto

9 years agoCreate init.zsh to make compatible with prezto
Aurélien Scoubeau [Mon, 19 Jan 2015 14:25:42 +0000 (15:25 +0100)]
Create init.zsh to make compatible with prezto

9 years agoMakefile: use CURDIR instead of PWD; used with 'make -C ..'
Daniel Hahler [Sat, 17 Jan 2015 19:43:59 +0000 (20:43 +0100)]
Makefile: use CURDIR instead of PWD; used with 'make -C ..'

9 years agoMerge pull request #17 from Tarrasch/dont-cd-in-chpwd
Daniel Hahler [Sat, 17 Jan 2015 19:39:06 +0000 (20:39 +0100)]
Merge pull request #17 from Tarrasch/dont-cd-in-chpwd

Do not `cd` in the `chpwd` hook: changes $PWD behavior in .env files!

9 years agoDo not `cd` in the `chpwd` hook
Daniel Hahler [Sat, 17 Jan 2015 16:03:02 +0000 (17:03 +0100)]
Do not `cd` in the `chpwd` hook

This is not really necessary, except for the convenience of being in the
.env file's directory during the hook.
But it messes around with the "cd history", e.g. `cd -`!

To reference the .env file or its directory, `$autoenv_env_file` and
`${autoenv_env_file:h}` can be used instead.

9 years agoSet autoenv_env_file in _autoenv_source
Daniel Hahler [Sat, 17 Jan 2015 15:39:04 +0000 (16:39 +0100)]
Set autoenv_env_file in _autoenv_source

9 years agoMinor cleanup: centralize call to _autoenv_stack_entered_add
Daniel Hahler [Sat, 17 Jan 2015 15:38:40 +0000 (16:38 +0100)]
Minor cleanup: centralize call to _autoenv_stack_entered_add

9 years agovarstash: use '==' for consistency
Daniel Hahler [Thu, 18 Dec 2014 19:52:52 +0000 (20:52 +0100)]
varstash: use '==' for consistency

9 years agotest_full: output extra newline between suites/variants
Daniel Hahler [Thu, 18 Dec 2014 19:52:36 +0000 (20:52 +0100)]
test_full: output extra newline between suites/variants

9 years agovarstash: fix pattern in stash
Daniel Hahler [Thu, 18 Dec 2014 19:36:54 +0000 (20:36 +0100)]
varstash: fix pattern in stash

9 years agovarstash: remove all usages of =~
Daniel Hahler [Thu, 18 Dec 2014 19:08:51 +0000 (20:08 +0100)]
varstash: remove all usages of =~

9 years agoHandle failure of loading zsh/stat
Daniel Hahler [Thu, 18 Dec 2014 18:45:48 +0000 (19:45 +0100)]
Handle failure of loading zsh/stat

9 years agovarstash: no need to use regex, avoids 'failed to load module: zsh/regex' error
Daniel Hahler [Thu, 18 Dec 2014 18:45:19 +0000 (19:45 +0100)]
varstash: no need to use regex, avoids 'failed to load module: zsh/regex' error

9 years agoREADME: add section about manual installation
Daniel Hahler [Thu, 11 Dec 2014 15:31:41 +0000 (16:31 +0100)]
README: add section about manual installation

9 years agoFix being loaded from a function (antigen)
Daniel Hahler [Thu, 11 Dec 2014 15:22:54 +0000 (16:22 +0100)]
Fix being loaded from a function (antigen)

Fixes https://github.com/Tarrasch/zsh-autoenv/issues/14

9 years agoFix autoloading of colors; just once
Daniel Hahler [Tue, 9 Dec 2014 23:09:04 +0000 (00:09 +0100)]
Fix autoloading of colors; just once

9 years agoInit arrays (see #14)
Daniel Hahler [Tue, 9 Dec 2014 22:12:38 +0000 (23:12 +0100)]
Init arrays (see #14)

9 years agominor: fix debug message ordering
Daniel Hahler [Tue, 9 Dec 2014 22:10:54 +0000 (23:10 +0100)]
minor: fix debug message ordering

9 years agoMerge pull request #16 from Tarrasch/tests-with-clobber
Daniel Hahler [Mon, 8 Dec 2014 21:29:06 +0000 (22:29 +0100)]
Merge pull request #16 from Tarrasch/tests-with-clobber

tests: setup for multiple ZDOTDIRs, fix/add "setopt clobber"

9 years agotests: setup for multiple ZDOTDIRs, fix/add "setopt clobber"
Daniel Hahler [Mon, 8 Dec 2014 21:12:30 +0000 (22:12 +0100)]
tests: setup for multiple ZDOTDIRs, fix/add "setopt clobber"

9 years agoCreate $AUTHENV_ENV_FILENAME if it does not exist
Srijan R Shetty [Mon, 8 Dec 2014 17:46:27 +0000 (23:16 +0530)]
Create $AUTHENV_ENV_FILENAME if it does not exist

9 years agoFixes after using `setopt nounset` during tests
Daniel Hahler [Mon, 8 Dec 2014 20:37:25 +0000 (21:37 +0100)]
Fixes after using `setopt nounset` during tests

Also add tests for unset variable with varstash.

9 years agoMerge pull request #12 from Tarrasch/autounstash-on-leave
Daniel Hahler [Thu, 4 Dec 2014 12:31:56 +0000 (13:31 +0100)]
Merge pull request #12 from Tarrasch/autounstash-on-leave

Call `autounstash` automatically/always when leaving a directory

9 years agoMerge pull request #13 from Tarrasch/fix-newline-handling-in-auth-file
Daniel Hahler [Thu, 4 Dec 2014 12:31:26 +0000 (13:31 +0100)]
Merge pull request #13 from Tarrasch/fix-newline-handling-in-auth-file

Fix newline handling in auth file

9 years agoCall `autounstash` automatically/always when leaving a directory
Daniel Hahler [Thu, 4 Dec 2014 04:36:12 +0000 (05:36 +0100)]
Call `autounstash` automatically/always when leaving a directory

9 years agoAdd doc for _autoenv_deauthorize
Daniel Hahler [Thu, 4 Dec 2014 09:39:46 +0000 (10:39 +0100)]
Add doc for _autoenv_deauthorize

9 years agoEncapsulate the file name in the hash pair for stricter matching
Daniel Hahler [Thu, 4 Dec 2014 09:35:09 +0000 (10:35 +0100)]
Encapsulate the file name in the hash pair for stricter matching

Ref: https://github.com/Tarrasch/zsh-autoenv/pull/13#issuecomment-65559752

9 years agoREADME: build status: use master branch, and .svg
Daniel Hahler [Thu, 4 Dec 2014 06:58:45 +0000 (07:58 +0100)]
README: build status: use master branch, and .svg

9 years agoFix _autoenv_deauthorize with regard to newline handling, add tests
Daniel Hahler [Thu, 4 Dec 2014 06:12:29 +0000 (07:12 +0100)]
Fix _autoenv_deauthorize with regard to newline handling, add tests

9 years agoHandle missing $1 in _autoenv_hash_pair
Daniel Hahler [Thu, 4 Dec 2014 06:11:52 +0000 (07:11 +0100)]
Handle missing $1 in _autoenv_hash_pair

9 years agogitignore tests/*.err
Daniel Hahler [Tue, 2 Dec 2014 21:49:01 +0000 (22:49 +0100)]
gitignore tests/*.err

9 years agoRemove underscore prefix from vars provided for .env files
Daniel Hahler [Tue, 2 Dec 2014 17:49:23 +0000 (18:49 +0100)]
Remove underscore prefix from vars provided for .env files

Fixes https://github.com/Tarrasch/zsh-autoenv/issues/11

9 years agoUse ${PWD:A} when checking for leave event
Daniel Hahler [Sat, 29 Nov 2014 12:56:28 +0000 (13:56 +0100)]
Use ${PWD:A} when checking for leave event

Use the absolute path when comparing to the absolute path of the
previously entered dirs.

9 years agoMerge pull request #8 from blueyed/next
Daniel Hahler [Thu, 27 Nov 2014 14:52:17 +0000 (15:52 +0100)]
Merge pull request #8 from blueyed/next

Next: varstash integration, tests refactoring, s/dotenv/autoenv/ and some more

9 years agoImprove interactive prompt
Daniel Hahler [Thu, 27 Nov 2014 12:33:04 +0000 (13:33 +0100)]
Improve interactive prompt

 - Revert usage of "read -q" for authentication (#10)
 - Change format of "not authenticated" message (#9)

9 years agoMake env_shasum local in _autoenv_hash_pair
Daniel Hahler [Thu, 27 Nov 2014 12:31:44 +0000 (13:31 +0100)]
Make env_shasum local in _autoenv_hash_pair

9 years agoAdd debugging, via AUTOENV_DEBUG>1
Daniel Hahler [Wed, 26 Nov 2014 18:42:57 +0000 (19:42 +0100)]
Add debugging, via AUTOENV_DEBUG>1

9 years agoMakefile: use test by default, improve for \*.t
Daniel Hahler [Wed, 26 Nov 2014 18:41:04 +0000 (19:41 +0100)]
Makefile: use test by default, improve for \*.t

9 years agoFix $PWD while sourcing .env file - should be dir of .env file
Daniel Hahler [Tue, 25 Nov 2014 13:39:43 +0000 (14:39 +0100)]
Fix $PWD while sourcing .env file - should be dir of .env file

9 years agoRename $_autoenv_this_dir to $_autoenv_source_dir
Daniel Hahler [Mon, 24 Nov 2014 19:19:25 +0000 (20:19 +0100)]
Rename $_autoenv_this_dir to $_autoenv_source_dir

9 years agoFix handling of stack for leave, add to stack for autoenv_source_parent
Daniel Hahler [Mon, 24 Nov 2014 19:12:45 +0000 (20:12 +0100)]
Fix handling of stack for leave, add to stack for autoenv_source_parent

9 years agotests: use sed to prepend to .env file
Daniel Hahler [Mon, 24 Nov 2014 18:03:51 +0000 (19:03 +0100)]
tests: use sed to prepend to .env file

9 years agoFix _autoenv_get_file_upwards for older Zsh
Daniel Hahler [Mon, 24 Nov 2014 17:51:20 +0000 (18:51 +0100)]
Fix _autoenv_get_file_upwards for older Zsh

9 years agoSome more refactoring, adding support for `autoenv_source_parent`
Daniel Hahler [Mon, 24 Nov 2014 16:48:51 +0000 (17:48 +0100)]
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

9 years agoUse AUTOENV prefix
Daniel Hahler [Fri, 21 Nov 2014 21:51:28 +0000 (22:51 +0100)]
Use AUTOENV prefix

 - s/DOTENV_/AUTOENV_/
 - s/dotenv_/autoenv_/

Ref: https://github.com/Tarrasch/zsh-autoenv/issues/6

9 years agoCleanup
Daniel Hahler [Fri, 21 Nov 2014 21:47:45 +0000 (22:47 +0100)]
Cleanup

9 years agoStreamline cwd behavior while sourcing
Daniel Hahler [Fri, 21 Nov 2014 21:33:00 +0000 (22:33 +0100)]
Streamline cwd behavior while sourcing

9 years agotests: add and use test_autoenv_add_to_env and test_autoenv_auth_env_files
Daniel Hahler [Fri, 21 Nov 2014 22:07:53 +0000 (23:07 +0100)]
tests: add and use test_autoenv_add_to_env and test_autoenv_auth_env_files

Conflicts:
autoenv.zsh

9 years agos/ENV_AUTHORIZATION_FILE/AUTOENV_ENV_FILENAME/
Daniel Hahler [Fri, 21 Nov 2014 19:15:08 +0000 (20:15 +0100)]
s/ENV_AUTHORIZATION_FILE/AUTOENV_ENV_FILENAME/

Ref: https://github.com/Tarrasch/zsh-autoenv/issues/6

9 years agoComments / doc
Daniel Hahler [Sun, 16 Nov 2014 10:28:43 +0000 (11:28 +0100)]
Comments / doc

9 years agovarstash integration
Daniel Hahler [Sat, 15 Nov 2014 19:59:39 +0000 (20:59 +0100)]
varstash integration

Fixes: https://github.com/Tarrasch/zsh-autoenv/issues/5
9 years agoAdopt varstash from http://github.com/cxreg/smartcd
Daniel Hahler [Sat, 15 Nov 2014 19:01:38 +0000 (20:01 +0100)]
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.

9 years agoAdd varstash from smartcd
Daniel Hahler [Sat, 15 Nov 2014 15:24:26 +0000 (16:24 +0100)]
Add varstash from smartcd

Source: https://github.com/cxreg/smartcd/blob/4fef3d3610873d9e8044cb5be1922fb056f4228d/lib/core/varstash

9 years agotests: inject '-t 1' to `read` during tests
Daniel Hahler [Fri, 21 Nov 2014 19:08:30 +0000 (20:08 +0100)]
tests: inject '-t 1' to `read` during tests

9 years agotests: add setup script, used to be for all tests
Daniel Hahler [Fri, 21 Nov 2014 19:07:06 +0000 (20:07 +0100)]
tests: add setup script, used to be for all tests

9 years agoSet DOTENV_LOOK_UPWARDS=1 by default
Daniel Hahler [Sun, 16 Nov 2014 11:35:17 +0000 (12:35 +0100)]
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

9 years agoMakefile: add targets for tests/*.t
Daniel Hahler [Mon, 24 Nov 2014 17:05:31 +0000 (18:05 +0100)]
Makefile: add targets for tests/*.t

9 years agoSet DOTENV_LOOK_UPWARDS=1 by default
Daniel Hahler [Sun, 16 Nov 2014 11:35:17 +0000 (12:35 +0100)]
Set DOTENV_LOOK_UPWARDS=1 by default

Fixes https://github.com/Tarrasch/zsh-autoenv/issues/3

9 years agoAdd tests for $PWD during enter and leave events
Daniel Hahler [Sun, 16 Nov 2014 11:05:16 +0000 (12:05 +0100)]
Add tests for $PWD during enter and leave events

9 years agoMerge pull request #4 from blueyed/improvements
Daniel Hahler [Sun, 16 Nov 2014 10:46:35 +0000 (11:46 +0100)]
Merge pull request #4 from blueyed/improvements

A lot of improvements, based on coming from "smartcd"

9 years agoUse 'test' as target for tests (common sense)
Daniel Hahler [Sun, 16 Nov 2014 10:40:09 +0000 (11:40 +0100)]
Use 'test' as target for tests (common sense)

9 years agodoc / small refactoring according to feedback
Daniel Hahler [Sun, 16 Nov 2014 10:39:10 +0000 (11:39 +0100)]
doc / small refactoring according to feedback

9 years ago_dotenv_source: use 'builtin cd' and stored dir instead of 'cd -'
Daniel Hahler [Sat, 15 Nov 2014 16:04:36 +0000 (17:04 +0100)]
_dotenv_source: use 'builtin cd' and stored dir instead of 'cd -'

9 years agoWrap sourcing in _dotenv_source: chdir and set _dotenv_cwd=$PWD
Daniel Hahler [Sat, 15 Nov 2014 15:09:37 +0000 (16:09 +0100)]
Wrap sourcing in _dotenv_source: chdir and set _dotenv_cwd=$PWD

9 years agoCheck for file existence in _dotenv_check_authorized_env_file
Daniel Hahler [Sat, 15 Nov 2014 15:09:02 +0000 (16:09 +0100)]
Check for file existence in _dotenv_check_authorized_env_file

9 years agoCleanup, and fixes (absolute path for env_file)
Daniel Hahler [Sat, 15 Nov 2014 14:48:57 +0000 (15:48 +0100)]
Cleanup, and fixes (absolute path for env_file)

9 years agoAdd a test for DOTENV_HANDLE_LEAVE=0
Daniel Hahler [Sat, 15 Nov 2014 14:25:20 +0000 (15:25 +0100)]
Add a test for DOTENV_HANDLE_LEAVE=0

9 years agoVarious improvements
Daniel Hahler [Sat, 15 Nov 2014 14:08:52 +0000 (15:08 +0100)]
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).

9 years agoUse 'local' in functions
Daniel Hahler [Sat, 15 Nov 2014 13:49:48 +0000 (14:49 +0100)]
Use 'local' in functions

9 years agoUse escaped grep command, skipping aliases
Daniel Hahler [Sat, 15 Nov 2014 12:59:42 +0000 (13:59 +0100)]
Use escaped grep command, skipping aliases

10 years agoAdd bitdeli badge
Arash Rouhani [Mon, 16 Sep 2013 09:27:08 +0000 (11:27 +0200)]
Add bitdeli badge

10 years agoForgot trailing white space
Arash Rouhani [Sun, 8 Sep 2013 16:54:17 +0000 (18:54 +0200)]
Forgot trailing white space

10 years agoAdd travis image
Arash Rouhani [Sun, 8 Sep 2013 16:50:20 +0000 (18:50 +0200)]
Add travis image

10 years agoAdd tests
Arash Rouhani [Sun, 8 Sep 2013 16:32:16 +0000 (18:32 +0200)]
Add tests

10 years agoAdd readme
Arash Rouhani [Sun, 8 Sep 2013 15:14:28 +0000 (17:14 +0200)]
Add readme

10 years agoAntigenify
Arash Rouhani [Sun, 8 Sep 2013 15:07:38 +0000 (17:07 +0200)]
Antigenify

10 years agoAdd source file
Arash Rouhani [Sun, 8 Sep 2013 15:06:26 +0000 (17:06 +0200)]
Add source file