Skip to content

Commit

Permalink
Updated for submodules.
Browse files Browse the repository at this point in the history
  • Loading branch information
manastalukdar committed Jan 10, 2021
1 parent 9054c52 commit 2e606fd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
15 changes: 13 additions & 2 deletions src/get_repositories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from mimetypes import init
import os
from reprlib import recursive_repr
import stat
import git
import json
Expand Down Expand Up @@ -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):
Expand Down
18 changes: 0 additions & 18 deletions src/repositories.json
Original file line number Diff line number Diff line change
@@ -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"
},
Expand Down

0 comments on commit 2e606fd

Please sign in to comment.