Commit 96f9ef54739841b53300624e7caa7fbc5b1d4519

Authored by Shrikant Sharat

Merge branch 'master' of https://github.com/xgarrido/antigen

Showing 1 changed file Side-by-side Diff

... ... @@ -5,6 +5,7 @@
5 5 # <repo-url>, <plugin-location>, <bundle-type>, <has-local-clone>
6 6 # FIXME: Is not kept local by zsh!
7 7 local _ANTIGEN_BUNDLE_RECORD=""
  8 +local _ANTIGEN_INSTALL_DIR="$(dirname $0)"
8 9  
9 10 # Syntaxes
10 11 # antigen-bundle <url> [<loc>=/]
... ... @@ -209,12 +210,10 @@ antigen-revert () {
209 210 # Save current revision.
210 211 local old_rev="$(--plugin-git rev-parse HEAD)"
211 212 # Pull changes if update requested.
212   - --plugin-git pull
  213 + (cd "$clone_dir" && git --no-pager pull)
  214 + #--plugin-git pull
213 215 # Update submodules.
214   - pushd
215   - cd "$clone_dir"
216   - git submodule update --recursive
217   - popd
  216 + (cd "$clone_dir" && git submodule update --recursive)
218 217 # Get the new revision.
219 218 local new_rev="$(--plugin-git rev-parse HEAD)"
220 219 fi
... ... @@ -295,6 +294,19 @@ antigen-revert () {
295 294  
296 295 }
297 296  
  297 +antigen-selfupdate () {
  298 + # Initiate subshell
  299 + (
  300 + cd $_ANTIGEN_INSTALL_DIR
  301 + # Sanity checks
  302 + if [ ! -d .git ]; then
  303 + echo "antigen is not under git CVS"
  304 + return 1
  305 + fi
  306 + git pull
  307 + )
  308 +}
  309 +
298 310 antigen-cleanup () {
299 311  
300 312 # Cleanup unused repositories.
... ... @@ -645,16 +657,17 @@ antigen () {
645 657  
646 658 # Setup antigen's autocompletion
647 659 _antigen () {
648   - compadd \
649   - bundle\
650   - bundles\
651   - update\
652   - revert\
653   - list\
654   - cleanup\
655   - lib\
656   - theme\
657   - apply\
  660 + compadd \
  661 + bundle \
  662 + bundles \
  663 + update \
  664 + revert \
  665 + list \
  666 + cleanup \
  667 + lib \
  668 + selfupdate \
  669 + theme \
  670 + apply \
658 671 help
659 672 }
660 673