update-context.sh 943 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env bash
  2. # update-context.sh — Claude Code integration: create/update CLAUDE.md
  3. #
  4. # Thin wrapper that delegates to the shared update-agent-context script.
  5. # Activated in Stage 7 when the shared script uses integration.json dispatch.
  6. #
  7. # Until then, this delegates to the shared script as a subprocess.
  8. set -euo pipefail
  9. # Derive repo root from script location (walks up to find .specify/)
  10. _script_dir="$(cd "$(dirname "$0")" && pwd)"
  11. _root="$_script_dir"
  12. while [ "$_root" != "/" ] && [ ! -d "$_root/.specify" ]; do _root="$(dirname "$_root")"; done
  13. if [ -z "${REPO_ROOT:-}" ]; then
  14. if [ -d "$_root/.specify" ]; then
  15. REPO_ROOT="$_root"
  16. else
  17. git_root="$(git rev-parse --show-toplevel 2>/dev/null || true)"
  18. if [ -n "$git_root" ] && [ -d "$git_root/.specify" ]; then
  19. REPO_ROOT="$git_root"
  20. else
  21. REPO_ROOT="$_root"
  22. fi
  23. fi
  24. fi
  25. exec "$REPO_ROOT/.specify/scripts/bash/update-agent-context.sh" claude