diff options
Diffstat (limited to 'Tools/check_submodules.sh')
-rwxr-xr-x | Tools/check_submodules.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Tools/check_submodules.sh b/Tools/check_submodules.sh new file mode 100755 index 000000000..1156490d7 --- /dev/null +++ b/Tools/check_submodules.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +if [ -d NuttX/nuttx ]; + then + STATUSRETVAL=$(git status --porcelain | grep -i "mavlink/include/mavlink/v1.0") + if [ "$STATUSRETVAL" == "" ]; then + echo "Checked mavlink submodule, correct version found" + else + echo "mavlink sub repo not at correct version. Try 'make updatesubmodules'" + echo "or follow instructions on http://pixhawk.org/dev/git/submodules" + exit 1 + fi +else + git submodule init; + git submodule update; +fi + + +if [ -d mavlink/include/mavlink/v1.0 ]; + then + STATUSRETVAL=$(git status --porcelain | grep -i "NuttX") + if [ "$STATUSRETVAL" == "" ]; then + echo "Checked NuttX submodule, correct version found" + else + echo "NuttX sub repo not at correct version. Try 'make updatesubmodules'" + echo "or follow instructions on http://pixhawk.org/dev/git/submodules" + exit 1 + fi +else + git submodule init; + git submodule update; +fi + +exit 0 |