Created
April 15, 2019 15:42
-
-
Save damilare/503164aefb10d91eacaa56530a14c2f1 to your computer and use it in GitHub Desktop.
Revisions
-
damilare created this gist
Apr 15, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ import os import subprocess with open('repos.txt') as f: for repo in f.readlines(): dir_name = repo.split('/')[1].split('.')[0] if os.path.exists(dir_name): print("Updating ... %s" % dir_name) subprocess.run(['git', '-C', dir_name, 'checkout', 'master']) subprocess.run(['git', '-C', dir_name, 'pull', 'origin', 'master']) else: print("Cloning... %s" % repo) subprocess.run(['git', 'clone', repo.strip()])