Skip to content

Commit

Permalink
Merge pull request #351 from rest-for-physics/submodule-recursive
Browse files Browse the repository at this point in the history
Pull submodules recursively
  • Loading branch information
jgalan authored Dec 13, 2022
2 parents 6f29637 + f792266 commit cadb987
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit cadb987

Please sign in to comment.