update.sh 470 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. set -e
  3. . scripts/modules.sh
  4. GLUONDIR="$(pwd)"
  5. for module in $GLUON_MODULES; do
  6. echo "--- Updating module '$module' ---"
  7. var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_')
  8. eval repo=\${${var}_REPO}
  9. eval branch=\${${var}_BRANCH}
  10. eval commit=\${${var}_COMMIT}
  11. mkdir -p "$GLUONDIR/$module"
  12. cd "$GLUONDIR/$module"
  13. git init
  14. if ! git branch -f base "$commit" 2>/dev/null; then
  15. git fetch "$repo" "$branch"
  16. git branch -f base "$commit"
  17. fi
  18. done