Last active
July 3, 2019 13:02
-
-
Save RyanFleck/af402d8d2e0111495bef9827c365000f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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