Update 2024-12-31 10:47 OpenBSD/amd64-t14
This commit is contained in:
35
.vim/bin/findtagsdir
Executable file
35
.vim/bin/findtagsdir
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
gitdir() {
|
||||
_path="$PWD"
|
||||
while [ -n "$_path" ]
|
||||
do [ -d "$_path/.git" ] \
|
||||
&& echo "$_path" \
|
||||
&& break
|
||||
_path="${_path%/*}"
|
||||
done
|
||||
}
|
||||
|
||||
cvsdir() {
|
||||
_path="$PWD"
|
||||
while [ -n "$_path" ]
|
||||
do
|
||||
[ ! -d "$_path/../CVS" ] \
|
||||
&& echo "$_path" \
|
||||
&& break
|
||||
_path="${_path%/*}"
|
||||
done
|
||||
}
|
||||
|
||||
_gitdir="$(gitdir)"
|
||||
_cvsdir="$(cvsdir)"
|
||||
|
||||
if [ -n "$_gitdir" ]
|
||||
then
|
||||
echo "$_gitdir/.git"
|
||||
elif [ -n "$_cvsdir" ]
|
||||
then
|
||||
echo "$_cvsdir/.tags"
|
||||
else
|
||||
echo "$PWD/.tags"
|
||||
fi
|
||||
Reference in New Issue
Block a user