fixing create_tag, adding git top dir lookup.

This commit is contained in:
2018-03-27 22:48:18 +01:00
parent c547c1d15a
commit ad86b0608c

View File

@@ -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"
CTAGS_ROOT="$PWD" if [ ! -f $PWD/$CTAGS_DIR_CFG ]; then
elif [ -f $PWD/../$CTAGS_DIR ]; then GIT_ROOT=$(git top pwd)
CTAGS_ROOT="$PWD/.." if [ -f $GIT_ROOT/$CTAGS_DIR_CFG ]; then
elif [ -f $PWD/../../$CTAGS_DIR]; then CTAGS_ROOT="$GIT_ROOT"
CTAGS_ROOT="$PWD/../.." fi
else
CTAGS_ROOT="$PWD"
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