update.sh 474 B

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