def get_repositories(): repositories = Node('repositories') cwd = os.getcwd() if not repositories.lexists(): cwd = Node('~/Workspace').path repositories = Node('~/Workspace/repositories') return cwd, repositories
def update_repositories(): cwd, repositories = get_repositories() repositories = repositories.readlines(breaklines=False) for repository in repositories: folder = Node(os.path.join(cwd, get_git_folder(repository))) if folder.lexists(): print('* Pull: %s' % repository) Run(['git', 'pull'], cwd=folder) else: print('* Clone: %s' % repository) Run(['git', 'clone', '--recursive', repository], cwd=cwd)