Commit eb1ebaf3c0a3fa06adb1286be9c7e19ce00f1a9f

Authored by Shrikant Sharat
1 parent 297f0f733e

Load `init.zsh` instead of `*.init.zsh`.

This is what prezto seems to be doing, from the source as of today.

Showing 1 changed file with 22 additions and 17 deletions Side-by-side Diff

... ... @@ -138,30 +138,36 @@ 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   - # prezto pmodload workaround
142   - if [[ "$1" == "https://github.com/sorin-ionescu/prezto.git" ]];then
  141 +
  142 + if [[ "$1" == "https://github.com/sorin-ionescu/prezto.git" ]]; then
  143 + # Prezto's directory *has* to be `.zprezto`.
143 144 echo .zprezto
  145 +
144 146 else
145 147 echo "$1" | sed \
146   - -e 's./.-SLASH-.g' \
147   - -e 's.:.-COLON-.g' \
148   - -e 's.|.-PIPE-.g'
  148 + -e 's./.-SLASH-.g' \
  149 + -e 's.:.-COLON-.g' \
  150 + -e 's.|.-PIPE-.g'
  151 +
149 152 fi
150 153 }
151 154  
152 155 -antigen-get-clone-url () {
153 156 # Takes a repo's clone dir and gives out the repo's original url that was
154 157 # used to create the given directory path.
155   -
156   - # prezto pmodload workaround
157   - if [[ "$1" == ".zprezto" ]];then
  158 +
  159 + if [[ "$1" == ".zprezto" ]]; then
  160 + # Prezto's (in `.zprezto`), is assumed to be from `sorin-ionescu`'s
  161 + # remote.
158 162 echo https://github.com/sorin-ionescu/prezto.git
  163 +
159 164 else
160 165 echo "$1" | sed \
161   - -e "s:^$ADOTDIR/repos/::" \
162   - -e 's.-SLASH-./.g' \
163   - -e 's.-COLON-.:.g' \
164   - -e 's.-PIPE-.|.g'
  166 + -e "s:^$ADOTDIR/repos/::" \
  167 + -e 's.-SLASH-./.g' \
  168 + -e 's.-COLON-.:.g' \
  169 + -e 's.-PIPE-.|.g'
  170 +
165 171 fi
166 172 }
167 173  
... ... @@ -251,15 +257,14 @@ antigen-revert () {
251 257 # FIXME: I don't know. Looks very very ugly. Needs a better
252 258 # implementation once tests are ready.
253 259 local script_loc="$(ls "$location" | grep -m1 '\.plugin\.zsh$')"
254   - local init_loc="$(ls "$location" | grep -m1 '\.init\.zsh$')"
255 260  
256 261 if [[ -f $location/$script_loc ]]; then
257 262 # If we have a `*.plugin.zsh`, source it.
258 263 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"
  264 +
  265 + elif [[ -f $location/init.zsh ]]; then
  266 + # If we have a `init.zsh`, source it.
  267 + source "$location/init.zsh"
263 268  
264 269 elif ls "$location" | grep -qm1 '\.zsh$'; then
265 270 # If there is no `*.plugin.zsh` file, source *all* the `*.zsh`