diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2023-05-02 09:23:23 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2023-05-02 09:23:23 -0700 |
commit | ff88f7328462317093c8d8b4a32178f1c9dc8090 (patch) | |
tree | e8a7850c7720951d5f2858ec1b2dfc2847875ca4 /bin | |
parent | TODO: Rename and reformat to TODO.md. (diff) | |
download | www-ff88f7328462317093c8d8b4a32178f1c9dc8090.tar.gz www-ff88f7328462317093c8d8b4a32178f1c9dc8090.tar.bz2 www-ff88f7328462317093c8d8b4a32178f1c9dc8090.zip |
bin/update-git-submodules: stay with master
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/update-git-submodules.sh | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/bin/update-git-submodules.sh b/bin/update-git-submodules.sh index bb796a5..c6ce223 100755 --- a/bin/update-git-submodules.sh +++ b/bin/update-git-submodules.sh @@ -1,7 +1,5 @@ #!/bin/bash -SUBMODULES=("_data/news" "glep") - # Ensure the script is in the base of the project directory. cd "$(dirname "$0")"/.. || exit @@ -10,16 +8,15 @@ echo -n 'Updating git submodules' # Verify git exists at runtime or safely skip this update if ! command -v git &> /dev/null; then echo "...skipped (git is not detected on the PATH)." - exit + exit 0 fi -for module in "${SUBMODULES[@]}"; do - printf ' %s' "${module}" - if [ -d "${module}/.git" ]; then - git submodule update --quiet --depth=1 "${module}" - else - git submodule update --quiet --depth=1 --init "${module}" - fi - done +# Git will iterate all modules for you, we want the master tip of the modules, +# not whatever is pinned in this repo. +if ! git submodule foreach --quiet 'git pull origin master --quiet' >/dev/null ; then + echo '...failed.' + exit 1 +fi echo '...done.' +exit 0 |