diff --git a/bin/update_submodules.sh b/bin/update_submodules.sh new file mode 100755 index 0000000000000000000000000000000000000000..9dcb9745849c01bbf61b9ffae92c5c7cc21a5a8f --- /dev/null +++ b/bin/update_submodules.sh @@ -0,0 +1,2 @@ +#!/bin/bash +git submodule update --init diff --git a/bootstrap/etc/lofar20rc.sh b/bootstrap/etc/lofar20rc.sh index e9e8ac326b32aa0130c98005e2f472457bb65f42..dd26d6df05ff731f4251035e97380c9ef9cebe1a 100755 --- a/bootstrap/etc/lofar20rc.sh +++ b/bootstrap/etc/lofar20rc.sh @@ -12,6 +12,10 @@ ABSOLUTE_PATH=$(realpath $(dirname ${BASH_SOURCE})) export LOFAR20_DIR=${1:-$(realpath ${ABSOLUTE_PATH}/../..)} +if [ ! -f "${LOFAR20_DIR}/.git/hooks/post-checkout" ]; then + alias git="cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-checkout; cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-merge; unalias git; git" +fi + # This needs to be modified for a development environment. # Example: ~/lofar2.0/tango # The current setting is for a production environment.