Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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()])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement