Commit 882de69123d3ae253604b2ba8229881b0bf24e2c
1 parent
4b8d7db1f1
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.
Showing 1 changed file with 9 additions and 4 deletions Side-by-side Diff
antigen.zsh
| ... | ... | @@ -80,17 +80,22 @@ bundle-install () { |
| 80 | 80 | mkdir -p "$ANTIGEN_BUNDLE_DIR" |
| 81 | 81 | |
| 82 | 82 | local handled_repos="" |
| 83 | + local install_bundles="" | |
| 83 | 84 | |
| 84 | 85 | if [[ $# != 0 ]]; then |
| 85 | 86 | # Record and install just the given plugin here and now. |
| 86 | 87 | bundle "$@" |
| 87 | - echo "$bundles" | tail -1 | |
| 88 | - | |
| 88 | + install_bundles="$(echo "$bundles" | tail -1)" | |
| 89 | 89 | else |
| 90 | 90 | # Install all the plugins, previously recorded. |
| 91 | - echo-non-empty "$bundles" | |
| 91 | + install_bundles="$(echo-non-empty "$bundles")" | |
| 92 | + fi | |
| 92 | 93 | |
| 93 | - fi | while read spec; do | |
| 94 | + # If the above `if` is directly piped to the below `while`, the contents | |
| 95 | + # inside the `if` construct are run in a new subshell, so changes to the | |
| 96 | + # `$bundles` variable are lost after the `if` construct finishes. So, we | |
| 97 | + # need the temporary `$install_bundles` variable. | |
| 98 | + echo "$install_bundles" | while read spec; do | |
| 94 | 99 | |
| 95 | 100 | local name="$(echo "$spec" | awk '{print $1}')" |
| 96 | 101 | local url="$(echo "$spec" | awk '{print $2}')" |