Commit 911cc8cb5a3e2ca6b63388147bda2caf81bd0e5e
1 parent
9dc6310031
Use ADOTDIR as the path to `.antigen` directory.
The previously used two variables ANTIGEN_REPO_CACHE and ANTIGEN_BUNDLE_DIR are now replaced by a single variable, ADOTDIR. Defaults to `$HOME/.antigen`.
Showing 2 changed files with 18 additions and 17 deletions Side-by-side Diff
README.mkd
| ... | ... | @@ -253,11 +253,13 @@ antigen. Make sure you set them *before* sourceing `antigen.zsh`. |
| 253 | 253 | used for `bundle` commands. The default value is robbyrussell's oh-my-zsh repo, |
| 254 | 254 | but you can set this to the fork url of your own fork. |
| 255 | 255 | |
| 256 | -`ANTIGEN_REPO_CACHE` — This is where the cloned repositories are cached. | |
| 257 | -Defaults to `$HOME/.antigen/cache` | |
| 256 | +`ADOTDIR` — This directory is used to store all the repo clones, your | |
| 257 | +bundles, themes, caches and everything else antigen requires to run smoothly. | |
| 258 | +Defaults to `$HOME/.antigen`. | |
| 258 | 259 | |
| 259 | -`ANTIGEN_BUNDLE_DIR` — This is where the plugins are installed and sourced | |
| 260 | -from. Defaults to `$HOME/.antigen/bundles` | |
| 260 | +**Note**: `ANTIGEN_REPO_CACHE` & `ANTIGEN_BUNDLE_DIR` — These variables | |
| 261 | +were used previously but are now removed. Please use `ADOTDIR` instead, as | |
| 262 | +mentioned above. | |
| 261 | 263 | |
| 262 | 264 | # Meta |
| 263 | 265 |
antigen.zsh
| ... | ... | @@ -50,7 +50,7 @@ bundle () { |
| 50 | 50 | fi |
| 51 | 51 | |
| 52 | 52 | # Plugin's repo will be cloned here. |
| 53 | - local clone_dir="$ANTIGEN_REPO_CACHE/$(echo "$url" \ | |
| 53 | + local clone_dir="$ADOTDIR/repos/$(echo "$url" \ | |
| 54 | 54 | | sed -e 's/\.git$//' -e 's./.-SLASH-.g' -e 's.:.-COLON-.g')" |
| 55 | 55 | |
| 56 | 56 | # Make an intelligent guess about the name of the plugin, if not already |
| ... | ... | @@ -76,7 +76,7 @@ bundle-install () { |
| 76 | 76 | shift |
| 77 | 77 | fi |
| 78 | 78 | |
| 79 | - mkdir -p "$ANTIGEN_BUNDLE_DIR" | |
| 79 | + mkdir -p "$ADOTDIR/bundles" | |
| 80 | 80 | |
| 81 | 81 | local handled_repos="" |
| 82 | 82 | local install_bundles="" |
| ... | ... | @@ -113,12 +113,12 @@ bundle-install () { |
| 113 | 113 | |
| 114 | 114 | if [[ $name != *.theme ]]; then |
| 115 | 115 | echo Installing $name |
| 116 | - local bundle_dest="$ANTIGEN_BUNDLE_DIR/$name" | |
| 116 | + local bundle_dest="$ADOTDIR/bundles/$name" | |
| 117 | 117 | test -e "$bundle_dest" && rm -rf "$bundle_dest" |
| 118 | 118 | ln -s "$clone_dir/$loc" "$bundle_dest" |
| 119 | 119 | else |
| 120 | - mkdir -p "$ANTIGEN_BUNDLE_DIR/$name" | |
| 121 | - cp "$clone_dir/$loc" "$ANTIGEN_BUNDLE_DIR/$name" | |
| 120 | + mkdir -p "$ADOTDIR/bundles/$name" | |
| 121 | + cp "$clone_dir/$loc" "$ADOTDIR/bundles/$name" | |
| 122 | 122 | fi |
| 123 | 123 | |
| 124 | 124 | bundle-load "$name" |
| ... | ... | @@ -136,16 +136,16 @@ bundle-install! () { |
| 136 | 136 | |
| 137 | 137 | bundle-cleanup () { |
| 138 | 138 | |
| 139 | - if [[ ! -d "$ANTIGEN_BUNDLE_DIR" || \ | |
| 140 | - "$(ls "$ANTIGEN_BUNDLE_DIR/" | wc -l)" == 0 ]]; then | |
| 139 | + if [[ ! -d "$ADOTDIR/bundles" || \ | |
| 140 | + "$(ls "$ADOTDIR/bundles/" | wc -l)" == 0 ]]; then | |
| 141 | 141 | echo "You don't have any bundles." |
| 142 | 142 | return 0 |
| 143 | 143 | fi |
| 144 | 144 | |
| 145 | - # Find directores in ANTIGEN_BUNDLE_DIR, that are not in the bundles record. | |
| 145 | + # Find directores in ADOTDIR/bundles, that are not in the bundles record. | |
| 146 | 146 | local unidentified_bundles="$(comm -13 \ |
| 147 | 147 | <(-bundle-echo-record | awk '{print $1}' | sort) \ |
| 148 | - <(ls -1 "$ANTIGEN_BUNDLE_DIR"))" | |
| 148 | + <(ls -1 "$ADOTDIR/bundles"))" | |
| 149 | 149 | |
| 150 | 150 | if [[ -z $unidentified_bundles ]]; then |
| 151 | 151 | echo "You don't have any unidentified bundles." |
| ... | ... | @@ -161,7 +161,7 @@ bundle-cleanup () { |
| 161 | 161 | echo |
| 162 | 162 | echo "$unidentified_bundles" | while read name; do |
| 163 | 163 | echo -n Deleting $name... |
| 164 | - rm -rf "$ANTIGEN_BUNDLE_DIR/$name" | |
| 164 | + rm -rf "$ADOTDIR/bundles/$name" | |
| 165 | 165 | echo ' done.' |
| 166 | 166 | done |
| 167 | 167 | else |
| ... | ... | @@ -173,7 +173,7 @@ bundle-cleanup () { |
| 173 | 173 | bundle-load () { |
| 174 | 174 | |
| 175 | 175 | local name="$1" |
| 176 | - local bundle_dir="$ANTIGEN_BUNDLE_DIR/$name" | |
| 176 | + local bundle_dir="$ADOTDIR/bundles/$name" | |
| 177 | 177 | |
| 178 | 178 | # Source the plugin script |
| 179 | 179 | local script_loc="$bundle_dir/$name.plugin.zsh" |
| ... | ... | @@ -234,8 +234,7 @@ bundle-list () { |
| 234 | 234 | # Pre-startup initializations |
| 235 | 235 | -set-default ANTIGEN_DEFAULT_REPO_URL \ |
| 236 | 236 | https://github.com/robbyrussell/oh-my-zsh.git |
| 237 | - -set-default ANTIGEN_REPO_CACHE $HOME/.antigen/cache | |
| 238 | - -set-default ANTIGEN_BUNDLE_DIR $HOME/.antigen/bundles | |
| 237 | + -set-default ADOTDIR $HOME/.antigen | |
| 239 | 238 | |
| 240 | 239 | # Load the compinit module |
| 241 | 240 | autoload -U compinit |