darkrc/bin/gitpath

10 lines
157 B
Text
Raw Normal View History

2020-02-04 14:48:13 +00:00
#!/bin/sh
top=$(git rev-parse --show-toplevel 2>/dev/null | sed -e 's/\//\\\//g')
if [ -n "$top" ]
then
echo $(pwd | sed -e "s/^$top//")
else
exit 1
fi