From f79ebf5a1876bfbbfff4f12e26d3335aa32727f3 Mon Sep 17 00:00:00 2001 From: Chu-Siang Lai Date: Mon, 19 Mar 2018 10:39:46 +0800 Subject: [PATCH] Refactor the make install with wildcard function Use the url of dymanic install script is not secutiry, so I manual handle it. Reference: * https://www.puritys.me/docs-blog/article-246-Makefile-%E7%9A%84%E5%AF%AB%E6%B3%95%E8%88%87%E7%94%A8%E9%80%94.html * https://github.com/Shougo/neobundle.vim/pull/515 * https://github.com/Shougo/dein.vim/blob/088c3ce80980ab7e1582b911610fd02809391892/doc/dein.txt#L1079 --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 778569d..6845c94 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ FILE_VIMRC=${HOME}/.vimrc FILE_GVIMRC=${HOME}/.gvimrc DIR_VIM=${HOME}/.vim DIR_VIM_BAK=${HOME}/.vim.bak-${TIMESTAMP} +DEIN_TARGET=~/.vim/bundle/repos/github.com/Shougo/dein.vim main: update @@ -35,9 +36,12 @@ install: cp -a _vim/ ${DIR_VIM} @echo '==> Install dein.vim ...' - curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > dein_installer.sh - sh ./dein_installer.sh ${DIR_VIM}/bundle/ - rm -f dein_installer.sh +ifneq ("$(wildcard ${DEIN_TARGET})","") + # Target of "${DEIN_TARGET}" is exist, ignore ... +else + mkdir -p ${DEIN_TARGET} + git clone https://github.com/Shougo/dein.vim ${DEIN_TARGET} +endif @echo '==> Install plugins ...' vim -c "try | call dein#install() | finally | qall! | endtry" -Ne