Browse Source

bin: add `repo-root`

Signed-off-by: Alejandro Mery <amery@geeks.cl>
master
Alejandro Mery 7 years ago
parent
commit
4f82defa60
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      files/bin/repo-root

+ 15
- 0
files/bin/repo-root

@ -0,0 +1,15 @@
#!/bin/sh
set -ue
d="$PWD"
while true; do
if [ "${d:-/}" = / ]; then
echo "$PWD"
exit 1
elif [ -s "$d/.repo/manifest.xml" ]; then
break
else
d="$(cd "$d/.." && pwd)"
fi
done
echo "$d"

Loading…
Cancel
Save