Created
February 19, 2020 11:10
-
-
Save flashblaze/b7e091a14093aa9f10fc5e38f7e0b5bf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import os | |
| # Change this path accordingly | |
| dir_path = "G:\\" | |
| names = os.listdir(dir_path) | |
| for name in names: | |
| if(os.path.isdir(dir_path+name)): | |
| count = 0 | |
| os.chdir(dir_path + name) | |
| sub_dirs = os.listdir() | |
| for sub_dir in sub_dirs: | |
| if(sub_dir == '.git'): | |
| os.system('git pull origin master') | |
| break | |
| else: | |
| count += 1 | |
| if(count == len(sub_dirs)-1): | |
| os.chdir(dir_path) | |
| with open('not_git_dirs.txt', 'a+') as file: | |
| file.write(name+'\n') | |
| break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment