Add gitpath command (experimental)

This commit is contained in:
Talia 2020-02-04 15:48:13 +01:00
parent 5ffb8982fc
commit 164a78d884

9
bin/gitpath Executable file
View file

@ -0,0 +1,9 @@
#!/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