From 9566bd96c31e379ef102d3efd6a3ad48a2626f8e Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Tue, 25 Aug 2020 14:21:15 +0200 Subject: [PATCH] Improve meta/submodules --init Keep output of git "live" (Meaning that one can see live what submodule is currently pulled) by not saving it first and then grepping but by catching a failing grep when the output of git was empty. --- meta/submodules | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/meta/submodules b/meta/submodules index b658eed..b1e1cf1 100644 --- a/meta/submodules +++ b/meta/submodules @@ -9,10 +9,9 @@ case "$1" in esac if (( $INIT )); then - out="$(git submodule update --init --recursive --jobs 8 --depth 1 2>&1)" - if ! (( $? )) && [ -n "$out" ] ; then - echo "$out" | grep "Cloning into" - fi + git submodule update --init --recursive --jobs 8 --depth 1 2>&1 \ + | grep "Cloning into" \ + || ! (( ${PIPESTATUS[0]} )) else git submodule update --remote fi