Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull submodules recursively #351

Merged
merged 1 commit into from
Dec 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pull-submodules.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def main():
# if 'force', override the changes with git reset
if force:
print("Forcing reset: ", end="")
p = subprocess.run(f"git submodule foreach 'git reset --hard'", #
p = subprocess.run(f"git submodule foreach --recursive 'git reset --hard'", #
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if debug:
print(p.stdout.decode("utf-8"))
Expand All @@ -210,7 +210,7 @@ def main():
# if latest, pull the latest commit instead of the one recorded in the main repo
if latest:
print("Pulling submodules: ", end="")
p = subprocess.run(f"git submodule foreach 'git fetch; if [ -z \"$(git ls-remote --heads origin {frameworkBranchName})\" ]; then git checkout master; else git checkout {frameworkBranchName};fi;git pull'", #
p = subprocess.run(f"git submodule foreach --recursive 'git fetch; if [ -z \"$(git ls-remote --heads origin {frameworkBranchName})\" ]; then git checkout master; else git checkout {frameworkBranchName};fi;git pull'", #
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if debug:
print(p.stdout.decode("utf-8"))
Expand All @@ -224,7 +224,7 @@ def main():
else:
print("[\033[92m OK \x1b[0m]")
# get commit id
p = subprocess.run(f"git submodule foreach 'git rev-parse HEAD'", #
p = subprocess.run(f"git submodule foreach --recursive 'git rev-parse HEAD'", #
shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print(p.stdout.decode("utf-8"))
Expand Down