Browse Source

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 years ago
parent
commit
fc8d478060
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      bitshift/crawler/indexer.py

+ 6
- 1
bitshift/crawler/indexer.py View File

@@ -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…
Cancel
Save