Add gitpath command (experimental)

This commit is contained in:
Talia 2020-02-04 15:48:13 +01:00
parent 5ffb8982fc
commit 164a78d884
1 changed files with 9 additions and 0 deletions

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