#!/usr/bin/env bash

# Copyright (c) Lawrence Livermore National Security, LLC and other
# Axom Project Contributors. See top-level LICENSE and COPYRIGHT
# files for dates and other details.
#
# SPDX-License-Identifier: (BSD-3-Clause)

##-----------------------------------------------------------------------
## post-checkout hook to automatically update submodules. 
##
## This hook is executed after every `git checkout` or `git clone` 
## commands. It ensures that the submodules are up-to-date with
## respect to the current HEAD. 
##-----------------------------------------------------------------------
reset=$(tput sgr0)
bold=$(tput bold)

echo "$bold updating submodules...$reset"
git submodule update --recursive
echo "$bold[DONE]$reset"
