Skip to content

Instantly share code, notes, and snippets.

@RyanFleck
Last active July 3, 2019 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanFleck/af402d8d2e0111495bef9827c365000f to your computer and use it in GitHub Desktop.
Save RyanFleck/af402d8d2e0111495bef9827c365000f to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import os
def crawlAndPullRepos():
issue_dirs = []
for dirname, subdirs, filenames in os.walk(os.getcwd()):
if '.git' in subdirs:
print("\nDirectory " + dirname + " is a git repository.")
output = os.system("cd " + dirname + " && git pull")
if(output != 0):
issue_dirs.append(dirname)
if(len(issue_dirs) > 0):
x = 0
print('\nErrors were thrown when attempting to pull ' +
str(len(issue_dirs)) + ' repositories:')
for repo in issue_dirs:
x = x + 1
print('\t' + str(x) + ': ' + repo)
crawlAndPullRepos()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment