From 882de69123d3ae253604b2ba8229881b0bf24e2c Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Date: Tue, 5 Jun 2012 18:28:33 +0530 Subject: [PATCH] Fix current theme is listed in cleanup. Current theme and the plugins installed on-spot in current session should not be listed in the cleanup list. They were because of a problem with updating the `$bundles` record. This is now fixed. If the above `if` is directly piped to the below `while`, the contents inside the `if` construct are run in a new subshell, so changes to the `$bundles` variable are lost after the `if` construct finishes. So, we need the temporary `$install_bundles` variable. --- antigen.zsh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/antigen.zsh b/antigen.zsh index 107d038..ebfe995 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -80,17 +80,22 @@ bundle-install () { mkdir -p "$ANTIGEN_BUNDLE_DIR" local handled_repos="" + local install_bundles="" if [[ $# != 0 ]]; then # Record and install just the given plugin here and now. bundle "$@" - echo "$bundles" | tail -1 - + install_bundles="$(echo "$bundles" | tail -1)" else # Install all the plugins, previously recorded. - echo-non-empty "$bundles" + install_bundles="$(echo-non-empty "$bundles")" + fi - fi | while read spec; do + # If the above `if` is directly piped to the below `while`, the contents + # inside the `if` construct are run in a new subshell, so changes to the + # `$bundles` variable are lost after the `if` construct finishes. So, we + # need the temporary `$install_bundles` variable. + echo "$install_bundles" | while read spec; do local name="$(echo "$spec" | awk '{print $1}')" local url="$(echo "$spec" | awk '{print $2}')" -- 2.0.0