Compute top-of-tree for docker volumes

This commit is contained in:
Carl D. Roth
2018-08-27 14:05:29 -07:00
committed by Wataru Ishida
parent b1fdd9d054
commit c351a360ca

14
docker/tools/gitroot Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
if test $# -gt 0; then
dir=$(realpath $1)
else
dir=$(pwd)
fi
while test $dir != /; do
if test -d $dir/.git; then
echo $dir
break
fi
dir=${dir%/*}
done