openattributegraph_setup.sh 975 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. # A `realpath` alternative using the default C implementation.
  3. filepath() {
  4. [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
  5. }
  6. REPO_ROOT="$(dirname $(dirname $(dirname $(filepath $0))))"
  7. clone_checkout_openattributegraph() {
  8. cd $REPO_ROOT
  9. revision=$(Scripts/CI/get_revision.sh openattributegraph)
  10. cd ..
  11. if [ ! -d OpenAttributeGraph ]; then
  12. gh repo clone OpenSwiftUIProject/OpenAttributeGraph
  13. cd OpenAttributeGraph
  14. else
  15. echo "OpenAttributeGraph already exists, skipping clone."
  16. cd OpenAttributeGraph
  17. git fetch --all --quiet
  18. git stash --quiet || true
  19. git reset --hard --quiet origin/main
  20. fi
  21. if [ -n "$revision" ]; then
  22. git checkout --quiet "$revision"
  23. else
  24. echo "No pinned revision for OpenAttributeGraph, using default branch."
  25. fi
  26. }
  27. update_openattributegraph() {
  28. cd $REPO_ROOT/../OpenAttributeGraph
  29. ./Scripts/CI/darwin_setup_build.sh
  30. }
  31. clone_checkout_openattributegraph
  32. update_openattributegraph