Commit 9dc6310031654abbb45268ab3992a971b9b628a7
1 parent
60d0dc5712
Rename bundle record variable to sound private.
Showing 1 changed file with 7 additions and 7 deletions Side-by-side Diff
antigen.zsh
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | # character. |
| 5 | 5 | # <bundle-name>, <repo-url>, <plugin-location>, <repo-local-clone-dir> |
| 6 | 6 | # FIXME: Is not kept local by zsh! |
| 7 | -local bundles="" | |
| 7 | +local _ANTIGEN_BUNDLE_RECORD="" | |
| 8 | 8 | |
| 9 | 9 | # Syntaxes |
| 10 | 10 | # bundle <url> [<loc>=/] [<name>] |
| ... | ... | @@ -60,7 +60,7 @@ bundle () { |
| 60 | 60 | fi |
| 61 | 61 | |
| 62 | 62 | # Add it to the record. |
| 63 | - bundles="$bundles\n$name $url $loc $clone_dir" | |
| 63 | + _ANTIGEN_BUNDLE_RECORD="$_ANTIGEN_BUNDLE_RECORD\n$name $url $loc $clone_dir" | |
| 64 | 64 | |
| 65 | 65 | # Load it, unless specified otherwise. |
| 66 | 66 | if $load; then |
| ... | ... | @@ -84,7 +84,7 @@ bundle-install () { |
| 84 | 84 | if [[ $# != 0 ]]; then |
| 85 | 85 | # Record and install just the given plugin here and now. |
| 86 | 86 | bundle "$@" |
| 87 | - install_bundles="$(echo "$bundles" | tail -1)" | |
| 87 | + install_bundles="$(-bundle-echo-record | tail -1)" | |
| 88 | 88 | else |
| 89 | 89 | # Install all the plugins, previously recorded. |
| 90 | 90 | install_bundles="$(-bundle-echo-record)" |
| ... | ... | @@ -92,8 +92,8 @@ bundle-install () { |
| 92 | 92 | |
| 93 | 93 | # If the above `if` is directly piped to the below `while`, the contents |
| 94 | 94 | # inside the `if` construct are run in a new subshell, so changes to the |
| 95 | - # `$bundles` variable are lost after the `if` construct finishes. So, we | |
| 96 | - # need the temporary `$install_bundles` variable. | |
| 95 | + # `$_ANTIGEN_BUNDLE_RECORD` variable are lost after the `if` construct | |
| 96 | + # finishes. So, we need the temporary `$install_bundles` variable. | |
| 97 | 97 | echo "$install_bundles" | while read spec; do |
| 98 | 98 | |
| 99 | 99 | local name="$(echo "$spec" | awk '{print $1}')" |
| ... | ... | @@ -217,7 +217,7 @@ bundle-apply () { |
| 217 | 217 | |
| 218 | 218 | bundle-list () { |
| 219 | 219 | # List all currently installed bundles |
| 220 | - if [[ -z "$bundles" ]]; then | |
| 220 | + if [[ -z "$_ANTIGEN_BUNDLE_RECORD" ]]; then | |
| 221 | 221 | echo "You don't have any bundles." >&2 |
| 222 | 222 | return 1 |
| 223 | 223 | else |
| ... | ... | @@ -227,7 +227,7 @@ bundle-list () { |
| 227 | 227 | |
| 228 | 228 | # Does what it says. |
| 229 | 229 | -bundle-echo-record () { |
| 230 | - echo "$bundles" | sed -n '1!p' | |
| 230 | + echo "$_ANTIGEN_BUNDLE_RECORD" | sed -n '1!p' | |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | -bundle-env-setup () { |