Răsfoiți Sursa

Make `dotfiles-upgrade` update vim plugins, Add to Makefile

It can now be run using `make upgrade`.
Weiyi Lou 9 ani în urmă
părinte
comite
112a4df239
3 a modificat fișierele cu 9 adăugiri și 6 ștergeri
  1. 6 3
      Makefile
  2. 1 1
      bin/dotfiles-upgrade
  3. 2 2
      vim/autoload/plug.vim

+ 6 - 3
Makefile

@@ -7,12 +7,12 @@ rm-all = rm-git rm-bash rm-zsh rm-tmux rm-ack rm-vimperator rm-vim
 
 # Auto-Documenting Section. Displays a target list with `##` descriptions.
 help:
-	@echo "Available tasks:"
+	@echo "* Available tasks:"
 	@grep -E '^[a-zA-Z_-]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "%-16s %s\n", $$1, $$2}'
 	@echo ""
-	@echo "Individual setup tasks:"
+	@echo "* Individual setup tasks:"
 	@echo "$(all)"
-.PHONY: help uninstall install $(all) $(rm-all)
+.PHONY: help install uninstall upgrade show-versions $(all) $(rm-all)
 
 install: prep $(all) ## Set up all configurations.
 	@echo "Install complete!"
@@ -20,6 +20,9 @@ install: prep $(all) ## Set up all configurations.
 uninstall: $(rm-all) ## Remove all configurations.
 	@echo "Uninstalled!"
 
+upgrade: ## Update external files to latest versions.
+	@./bin/dotfiles-upgrade
+
 show-versions: ## List versions of installed software.
 	@./bin/show-versions
 

+ 1 - 1
bin/dotfiles-upgrade

@@ -59,7 +59,7 @@ curl -# https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/plugins/
   -o ~/dotfiles/shell/common/coloured-man-pages.sh
 
 echo "vim-plug"
-vim +PlugUpgrade +quitall!
+vim +PlugUpgrade +PlugUpdate! +quitall!
 
 echo "submodules"
 (cd ~/dotfiles && git submodule foreach git pull origin master)

+ 2 - 2
vim/autoload/plug.vim

@@ -955,7 +955,7 @@ function! s:update_finish()
   endif
   if s:switch_in()
     call append(3, '- Updating ...') | 4
-    for [name, spec] in items(filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && (s:update.pull || has_key(s:update.new, v:key))'))
+    for [name, spec] in items(filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && (s:update.force || s:update.pull || has_key(s:update.new, v:key))'))
       let pos = s:logpos(name)
       if !pos
         continue
@@ -973,7 +973,7 @@ function! s:update_finish()
               \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only origin/'.branch.' 2>&1')), spec.dir)
       endif
       if !v:shell_error && filereadable(spec.dir.'/.gitmodules') &&
-            \ (has_key(s:update.new, name) || s:is_updated(spec.dir))
+            \ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir))
         call s:log4(name, 'Updating submodules. This may take a while.')
         let out .= s:bang('git submodule update --init --recursive 2>&1', spec.dir)
       endif