You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
197 B

  1. #!/bin/sh
  2. set -ue
  3. d="$PWD"
  4. while true; do
  5. if [ "${d:-/}" = / ]; then
  6. echo "$PWD"
  7. exit 1
  8. elif [ -s "$d/.repo/manifest.xml" ]; then
  9. break
  10. else
  11. d="$(cd "$d/.." && pwd)"
  12. fi
  13. done
  14. echo "$d"