diff --git a/.gitignore b/.gitignore index c45b30ef..257f8977 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ temp_dirs/undodir/* -sources_non_forked/* +sources_non_forked_cache/* temp_dirs/yankring_history_v2.txt sources_forked/yankring/doc/tags my_plugins/ diff --git a/update_plugins.py b/update_plugins.py index d93de43b..c6653527 100644 --- a/update_plugins.py +++ b/update_plugins.py @@ -11,6 +11,7 @@ import shutil import tempfile import urllib.request import zipfile +from distutils.dir_util import copy_tree from io import BytesIO from os import path @@ -68,8 +69,8 @@ jedi-vim https://github.com/davidhalter/jedi-vim GITHUB_ZIP = "%s/archive/master.zip" -SOURCE_DIR = path.join(path.dirname(__file__), "sources_non_forked") - +FALLBACK_SOURCE_DIR = path.join(path.dirname(__file__), "sources_non_forked") +SOURCE_DIR = path.join(path.dirname(__file__), "sources_non_forked_cache") def download_extract_replace(plugin_name, zip_path, temp_dir, source_dir): # Download and extract file in temp dir @@ -105,6 +106,9 @@ def update(plugin): if __name__ == "__main__": temp_directory = tempfile.mkdtemp() + if not path.isdir(SOURCE_DIR): + copy_tree(FALLBACK_SOURCE_DIR, SOURCE_DIR) + try: if futures: with futures.ThreadPoolExecutor(16) as executor: diff --git a/vimrcs/plugins_config.vim b/vimrcs/plugins_config.vim index a418f4ee..fba02394 100644 --- a/vimrcs/plugins_config.vim +++ b/vimrcs/plugins_config.vim @@ -10,7 +10,7 @@ """""""""""""""""""""""""""""" let s:vim_runtime = expand(':p:h')."/.." call pathogen#infect(s:vim_runtime.'/sources_forked/{}') -call pathogen#infect(s:vim_runtime.'/sources_non_forked/{}') +call pathogen#infect(s:vim_runtime.'/sources_non_forked_cache/{}') call pathogen#infect(s:vim_runtime.'/my_plugins/{}') call pathogen#helptags()