ai-rebase.sh 667 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. set -e
  3. # Check for required Git configuration files
  4. if [ ! -f "$HOME/.gitconfig" ]; then
  5. >&2 echo "Error: Git configuration file not found at $HOME/.gitconfig"
  6. exit 1
  7. fi
  8. if [ ! -f "$HOME/.git-credentials" ]; then
  9. >&2 echo "Error: Git credentials file not found at $HOME/.git-credentials"
  10. exit 1
  11. fi
  12. git fetch "$@"
  13. docker run --rm -it \
  14. -v "$(pwd):/repo" \
  15. -v "$HOME/.gitconfig:/home/appuser/.gitconfig:ro" \
  16. -v "$HOME/.git-credentials:/home/appuser/.git-credentials:ro" \
  17. -e GEMINI_API_KEY="$GEMINI_API_KEY" \
  18. -e GEMINI_MODEL="${GEMINI_MODEL:-gemini-2.0-flash}" \
  19. -u "$(id -u):$(id -g)" \
  20. "${DOCKER_IMAGE_NAME:-senomas/git-rebase:1.0}" "$@"