aboutsummaryrefslogtreecommitdiff
blob: c6ce2239f826070df485c313a41b49a9bd640213 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# Ensure the script is in the base of the project directory.
cd "$(dirname "$0")"/.. || exit

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 0
fi

# 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