From c3198e0aa07428afb76c5503ac8e6118ad233149 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Sun, 24 Feb 2013 21:05:01 +0530 Subject: [PATCH] Set `$ZSH` to oh-my-zsh clone location in `-lib`. Fix #46. Some plugins seem to rely on the `$ZSH` variable pointing to the oh-my-zsh clone being used. See README for more. --- README.mkd | 9 ++++++--- antigen.zsh | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.mkd b/README.mkd index 3a7f78b..94766c3 100644 --- a/README.mkd +++ b/README.mkd @@ -350,19 +350,22 @@ usable in a non-interactive fashion. ### antigen-lib -This is a shortcut to +This is (almost) the same as antigen-bundle --loc=lib So, it basically installs the oh-my-zsh's library as a bundle. +One other thing it does is that some oh-my-zsh plugins expect a `$ZSH` set to +the full path of the oh-my-zsh clone being used. This is also set to the +correct path, if not already set to something else. + Please note that this assumes that the `ANTIGEN_DEFAULT_REPO_URL` is set to the oh-my-zsh repo or a fork of that repo. If you want to specify the `url` too, then you can't use the `antigen-lib` short cut. You have to do that directly with the `antigen-bundle` command. -This is present only for legacy reasons and *might* (or might not) be removed in -the future. +This is present to ease dealing with oh-my-zsh plugins. Use diff --git a/antigen.zsh b/antigen.zsh index 5e397e9..1f93f0f 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -364,6 +364,9 @@ antigen-cleanup () { } antigen-lib () { + if [[ -z "$ZSH" ]]; then + export ZSH="$(-antigen-get-clone-dir "$ANTIGEN_DEFAULT_REPO_URL")" + fi antigen-bundle --loc=lib } -- 2.0.0