Commit c0ee02666f3790a41664db2dd2e4cda8fb5b5f5d
Committed by
Shrikant Sharat
1 parent
9a97880f48
add support for prezto plugins
Showing 1 changed file with 23 additions and 2 deletions Side-by-side Diff
antigen.zsh
| ... | ... | @@ -138,20 +138,31 @@ antigen-revert () { |
| 138 | 138 | # Takes a repo url and gives out the path that this url needs to be cloned |
| 139 | 139 | # to. Doesn't actually clone anything. |
| 140 | 140 | echo -n $ADOTDIR/repos/ |
| 141 | - echo "$1" | sed \ | |
| 141 | + # prezto pmodload workaround | |
| 142 | + if [[ "$1" == "https://github.com/sorin-ionescu/prezto.git" ]];then | |
| 143 | + echo -n .zprezto | |
| 144 | + else | |
| 145 | + echo -n "$1" | sed \ | |
| 142 | 146 | -e 's./.-SLASH-.g' \ |
| 143 | 147 | -e 's.:.-COLON-.g' \ |
| 144 | 148 | -e 's.|.-PIPE-.g' |
| 149 | + fi | |
| 145 | 150 | } |
| 146 | 151 | |
| 147 | 152 | -antigen-get-clone-url () { |
| 148 | 153 | # Takes a repo's clone dir and gives out the repo's original url that was |
| 149 | 154 | # used to create the given directory path. |
| 150 | - echo "$1" | sed \ | |
| 155 | + | |
| 156 | + # prezto pmodload workaround | |
| 157 | + if [[ "$1" == ".zprezto" ]];then | |
| 158 | + echo -n https://github.com/sorin-ionescu/prezto.git | |
| 159 | + else | |
| 160 | + echo -n "$1" | sed \ | |
| 151 | 161 | -e "s:^$ADOTDIR/repos/::" \ |
| 152 | 162 | -e 's.-SLASH-./.g' \ |
| 153 | 163 | -e 's.-COLON-.:.g' \ |
| 154 | 164 | -e 's.-PIPE-.|.g' |
| 165 | + fi | |
| 155 | 166 | } |
| 156 | 167 | |
| 157 | 168 | -antigen-ensure-repo () { |
| ... | ... | @@ -240,10 +251,15 @@ antigen-revert () { |
| 240 | 251 | # FIXME: I don't know. Looks very very ugly. Needs a better |
| 241 | 252 | # implementation once tests are ready. |
| 242 | 253 | local script_loc="$(ls "$location" | grep -m1 '\.plugin\.zsh$')" |
| 254 | + local init_loc="$(ls "$location" | grep -m1 '\.init\.zsh$')" | |
| 243 | 255 | |
| 244 | 256 | if [[ -f $location/$script_loc ]]; then |
| 245 | 257 | # If we have a `*.plugin.zsh`, source it. |
| 246 | 258 | source "$location/$script_loc" |
| 259 | + | |
| 260 | + elif [[ -f $location/$init_loc ]]; then | |
| 261 | + # If we have a `*.init.zsh`, source it. | |
| 262 | + source "$location/$init_loc" | |
| 247 | 263 | |
| 248 | 264 | elif ls "$location" | grep -qm1 '\.zsh$'; then |
| 249 | 265 | # If there is no `*.plugin.zsh` file, source *all* the `*.zsh` |
| ... | ... | @@ -318,6 +334,11 @@ antigen-lib () { |
| 318 | 334 | antigen-bundle --loc=lib |
| 319 | 335 | } |
| 320 | 336 | |
| 337 | +antigen-prezto-lib() { | |
| 338 | + antigen-bundle sorin-ionescu/prezto | |
| 339 | + export ZDOTDIR=$ADOTDIR/repos/ | |
| 340 | +} | |
| 341 | + | |
| 321 | 342 | antigen-theme () { |
| 322 | 343 | |
| 323 | 344 | if [[ "$1" != */* && "$1" != --* ]]; then |