From b4efcb3e320a0876adb7ae361fb62c8ef5826990 Mon Sep 17 00:00:00 2001 From: JuanAn Garcia Date: Wed, 15 Feb 2023 17:51:56 +0100 Subject: [PATCH] Appending true to git submodule foreach command to avoid modules not being updated in case of failure --- pull-submodules.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pull-submodules.py b/pull-submodules.py index 61be052ca..3a0d61149 100644 --- a/pull-submodules.py +++ b/pull-submodules.py @@ -233,7 +233,7 @@ def main(): if force: print("Forcing reset: ", end="") p = subprocess.run( - f"git submodule foreach --recursive 'git reset --hard'", # + f"git submodule foreach --recursive 'git reset --hard || true'", # shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, @@ -259,7 +259,7 @@ def main(): if latest: print("Pulling submodules: ", end="") 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'", # + 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 || true'", # shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, @@ -282,7 +282,7 @@ def main(): print("[\033[92m OK \x1b[0m]") # get commit id p = subprocess.run( - f"git submodule foreach --recursive 'git rev-parse HEAD'", # + f"git submodule foreach --recursive 'git rev-parse HEAD || true'", # shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,