Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import os
  2. import subprocess
  3.  
  4. with open('repos.txt') as f:
  5. for repo in f.readlines():
  6. dir_name = repo.split('/')[1].split('.')[0]
  7. if os.path.exists(dir_name):
  8. print("Updating ... %s" % dir_name)
  9. subprocess.run(['git', '-C', dir_name, 'checkout', 'master'])
  10. subprocess.run(['git', '-C', dir_name, 'pull', 'origin', 'master'])
  11. else:
  12. print("Cloning... %s" % repo)
  13. subprocess.run(['git', 'clone', repo.strip()])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement