X-Git-Url: https://git.ao2.it/config/vcsh.git/blobdiff_plain/e7109b26ca3742d660d77df5a94326297f00eaa0..0a50375aa4ea1d908e024e2ed8706a4c64670600:/.config/vcsh/hooks-available/submodule-update.sh diff --git a/.config/vcsh/hooks-available/submodule-update.sh b/.config/vcsh/hooks-available/submodule-update.sh index 34793ed..3f68fbc 100755 --- a/.config/vcsh/hooks-available/submodule-update.sh +++ b/.config/vcsh/hooks-available/submodule-update.sh @@ -1,4 +1,15 @@ #!/bin/sh +set -e + +GIT_VERSION_MAJOR=$(git --version | sed -n 's/.* \([0-9]\{1,\}\)\..*/\1/p' ) +GIT_VERSION_MINOR=$(git --version | sed -n 's/.* \([0-9]\{1,\}\)\.\([0-9]\{1,\}\).*/\2/p' ) + +if [ "$GIT_VERSION_MAJOR" -lt 2 ] || [ "$GIT_VERSION_MINOR" -lt 20 ]; +then + echo "Git >= 2.20 is required for submodules to work properly with vcsh" 1>&2 + exit 1 +fi + git submodule sync --recursive git submodule update --init --recursive