mirror of
1
0
Fork 0

Use cache folder for sources_non_forked

This commit is contained in:
Wu Tingfeng 2022-10-24 02:19:21 +08:00
parent f8be2919e7
commit 06826a2b74
No known key found for this signature in database
3 changed files with 8 additions and 4 deletions

2
.gitignore vendored
View File

@ -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/

View File

@ -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:

View File

@ -10,7 +10,7 @@
""""""""""""""""""""""""""""""
let s:vim_runtime = expand('<sfile>: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()