update-submodules 310 B

123456789101112131415161718
  1. #!/bin/sh
  2. basedir="$(dirname "$0")"
  3. [ "$(echo "$basedir" | cut -c1)" = '/' ] || basedir="$PWD/$basedir"
  4. die()
  5. {
  6. echo "$*" >&2
  7. exit 1
  8. }
  9. echo "Updating git submodules..."
  10. cd "$basedir/.." || die "Failed to cd to basedir"
  11. git submodule update --init --recursive || die "git submodule update failed"
  12. exit 0