diff --git a/README.md b/README.md index 2ae5f3c..74b6e8f 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,12 @@ git submodule init To update all submodules and print a list of those who received an update, run ```shell -if stdout="$(git submodule update --remote)"; then +if output="$(git submodule update --remote 2>&1)"; then # We capture only the part after "pkg" until the next "'" using sed # Source: https://unix.stackexchange.com/a/165590/315162 - sed 's|^Submodule path '\''pkg/\([^'\'']*\).*|\1|' <<< "$stdout" + sed 's|^Submodule path '\''pkg/\([^'\'']*\).*|\1|' <<< "$output" +else + echo "$output" fi ```