fixing create_tag, adding git top dir lookup.
This commit is contained in:
@@ -282,6 +282,7 @@ function cgrep() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function create_tags() {
|
function create_tags() {
|
||||||
#Bloomberg
|
#Bloomberg
|
||||||
if [ -e /opt/swt/bin/ctags ]; then
|
if [ -e /opt/swt/bin/ctags ]; then
|
||||||
@@ -294,21 +295,19 @@ function create_tags() {
|
|||||||
CTAGS_OPT+='--totals=yes '
|
CTAGS_OPT+='--totals=yes '
|
||||||
CTAGS_OPT+='--tag-relative=yes '
|
CTAGS_OPT+='--tag-relative=yes '
|
||||||
|
|
||||||
CTAGS_DIR='.ctags_dir'
|
CTAGS_DIR_CFG='.ctags_dir'
|
||||||
if [ -f $PWD/$CTAGS_DIR ]; then
|
|
||||||
CTAGS_ROOT="$PWD"
|
|
||||||
elif [ -f $PWD/../$CTAGS_DIR ]; then
|
|
||||||
CTAGS_ROOT="$PWD/.."
|
|
||||||
elif [ -f $PWD/../../$CTAGS_DIR]; then
|
|
||||||
CTAGS_ROOT="$PWD/../.."
|
|
||||||
else
|
|
||||||
CTAGS_ROOT="$PWD"
|
CTAGS_ROOT="$PWD"
|
||||||
|
if [ ! -f $PWD/$CTAGS_DIR_CFG ]; then
|
||||||
|
GIT_ROOT=$(git top pwd)
|
||||||
|
if [ -f $GIT_ROOT/$CTAGS_DIR_CFG ]; then
|
||||||
|
CTAGS_ROOT="$GIT_ROOT"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f $CTAGS_ROOT/$CTAGS_DIR ]; then
|
if [ -f $CTAGS_ROOT/$CTAGS_DIR_CFG ]; then
|
||||||
CTAGS_SRC="-L $CTAGS_ROOT/$CTAGS_DIR"
|
CTAGS_SRC="-L $CTAGS_ROOT/$CTAGS_DIR"
|
||||||
else
|
else
|
||||||
CTAGS_SRC="$%"
|
CTAGS_SRC="$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $CTAGS_ROOT
|
cd $CTAGS_ROOT
|
||||||
|
|||||||
Reference in New Issue
Block a user