openattributegraph_setup.sh 978 B

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