diff --git a/src/get_repositories.py b/src/get_repositories.py index 8cf48da..9a6864b 100644 --- a/src/get_repositories.py +++ b/src/get_repositories.py @@ -1,4 +1,6 @@ +from mimetypes import init import os +from reprlib import recursive_repr import stat import git import json @@ -28,8 +30,17 @@ def clone_repositories(list): clean_repositories_dir(parent_folder) for item in list: folder_name = get_folder_name(item['url']) - git.Repo.clone_from(item['url'], - os.path.join(parent_folder, folder_name)) + local_path = os.path.join(parent_folder, folder_name) + git.Repo.clone_from(item['url'], local_path) + repo = git.Repo(local_path) + #repo.submodule_update(init=True, recursive=True) + repo.git.submodule('update', '--init', '--recursive', '--remote', + '--merge') + # for submodule in repo.submodules: + # submodule.update(init=True, + # recursive=True, + # remote=True, + # merge=True) def get_folder_name(url): diff --git a/src/repositories.json b/src/repositories.json index a8019d6..8ece796 100644 --- a/src/repositories.json +++ b/src/repositories.json @@ -1,22 +1,4 @@ [ - { - "url": "https://github.com/computer-science-engineering/notes-book_ddia" - }, - { - "url": "https://github.com/computer-science-engineering/notes-book_bmdfgs" - }, - { - "url": "https://github.com/computer-science-engineering/notes-book_dsffp" - }, - { - "url": "https://github.com/computer-science-engineering/notes-book_prm" - }, - { - "url": "https://github.com/computer-science-engineering/notes-book_i-heart-logs_jay-kreps" - }, - { - "url": "https://github.com/computer-science-engineering/notes-book_scaling-teams_grosse_loftesness" - }, { "url": "https://github.com/computer-science-engineering/learning-computer-science" },