From d5dbc9648c54a3e000c9f883e8bba8b9926b931d Mon Sep 17 00:00:00 2001 From: Chris Rose Date: Sun, 17 Nov 2013 09:20:57 -0800 Subject: [PATCH] Add support for kennethreitz/autoenv --- modules/autoenv/README.md | 16 ++++++++++++++++ modules/autoenv/init.zsh | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 modules/autoenv/README.md create mode 100644 modules/autoenv/init.zsh diff --git a/modules/autoenv/README.md b/modules/autoenv/README.md new file mode 100644 index 00000000..f5895405 --- /dev/null +++ b/modules/autoenv/README.md @@ -0,0 +1,16 @@ +Autoenv +======= + +Provides integration for the [autoenv][1] shell environment settings +tool. + +Settings +-------- + +By default this plugin finds autoenv as it's installed by Mac homebrew, +in `/usr/local/opt/autoenv/activate.sh`. To find the autoenv script in +another location, add the following line to *zpreztorc*: + + zstyle ':prezto:module:autoenv' script PATH_TO_AUTOENV_ACTIVATE + +[1]: https://github.com/kennethreitz/autoenv diff --git a/modules/autoenv/init.zsh b/modules/autoenv/init.zsh new file mode 100644 index 00000000..523ca6ac --- /dev/null +++ b/modules/autoenv/init.zsh @@ -0,0 +1,14 @@ +# silently falls back to '' if homebrew is not installed +_autoenv_base=$(brew --prefix 2>/dev/null) + +zstyle -s ':prezto:module:autoenv' script "_autoenv_script" || _autoenv_script=${_autoenv_base}/opt/autoenv/activate.sh + +if [[ -s $_autoenv_script ]]; then + source $_autoenv_script + unset _autoenv_script + unset _autoenv_base +else + unset _autoenv_script + unset _autoenv_base + return 1 +fi