瀏覽代碼

Untested fix #33.

Add:
    bitshift/crawler/indexer.py
        -Add conditional to remove the full path of a repository if the owner's
        directory contains only one sub-directory.
tags/v1.0^2
Severyn Kozak 10 年之前
父節點
當前提交
fc8d478060
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. +6
    -1
      bitshift/crawler/indexer.py

+ 6
- 1
bitshift/crawler/indexer.py 查看文件

@@ -121,7 +121,12 @@ class GitIndexer(threading.Thread):
self._logger.exception("Exception raised while indexing:")
finally:
if os.path.isdir("%s/%s" % (GIT_CLONE_DIR, repo.name)):
shutil.rmtree("%s/%s" % (GIT_CLONE_DIR, repo.name))
if len([obj for obj in os.listdir('.') if
os.path.isdir(obj)]) <= 1:
shutil.rmtree("%s/%s" % (
GIT_CLONE_DIR, repo.name.split("/")[0]))
else:
shutil.rmtree("%s/%s" % (GIT_CLONE_DIR, repo.name))

def _insert_repository_codelets(self, repo):
"""


Loading…
取消
儲存