Skip to content

Commit

Permalink
refactor(repo): Don't traverse into git repos
Browse files Browse the repository at this point in the history
  • Loading branch information
kylef committed Jul 21, 2018
1 parent 69fbc1d commit 945f085
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions maintain/commands/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ def gather_repositories():
searches for them in the current working directory.
"""

for (root, dirs, files) in os.walk('.'):
basename = os.path.basename(root)

if basename != '.git':
for (root, dirs, files) in os.walk('.', topdown=True):
if '.git' not in dirs:
continue

path= os.path.split(root)[0]
for dir in list(dirs):
dirs.remove(dir)

path = os.path.split(root)[1]
repo = os.path.basename(path)
yield (repo, path)
yield (repo, root)


@click.group()
Expand Down

0 comments on commit 945f085

Please sign in to comment.