123456789101112131415161718192021222324 |
- #!/usr/bin/python
- import sys, os
- import ConfigParser, re
- from git import *
- config = ConfigParser.ConfigParser()
- config.read(os.path.expanduser(os.path.join('~', '.gitrepolist')))
- repos = re.split(',', config.get('repos', 'list'))
- if len(sys.argv) > 1:
- repodir = config.get(sys.argv[1], 'directory')
- print("Pushing Repository " + sys.argv[1] + " Location: " + repodir)
- repo = Repo(repodir)
- repo.remotes.origin.push()
- else:
- for reponame in repos:
- repodir = config.get(reponame, 'directory')
- # branch = config.get(reponame, 'branch')
- print("Pushing repository: " + reponame + ", Location: " + repodir)
- repo = Repo(repodir)
- repo.remotes.origin.push()
|