Add gitpath command (experimental)
This commit is contained in:
parent
5ffb8982fc
commit
164a78d884
1 changed files with 9 additions and 0 deletions
9
bin/gitpath
Executable file
9
bin/gitpath
Executable 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
|
Loading…
Reference in a new issue