From 6b25f5d60056614c58c5762a9c6e1fe8919742d2 Mon Sep 17 00:00:00 2001 From: bmckeough-showcaseidx <77012471+bmckeough-showcaseidx@users.noreply.github.com> Date: Wed, 17 Feb 2021 22:35:55 -0600 Subject: [PATCH] Revise index-tags script (#742) * Revise index-tags script - based what files are included in tag generation on the files managed by git. Exclude files not managed by git * Revert ctags command to recursively tag all files --- libexec/index-tags | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libexec/index-tags b/libexec/index-tags index 3c4478e2..51a6d516 100755 --- a/libexec/index-tags +++ b/libexec/index-tags @@ -6,10 +6,12 @@ set -e -trap "rm -f $GIT_DIR/tags.$$" EXIT -err_file=$GIT_DIR/ctags.err -if ctags --tag-relative -Rf$GIT_DIR/tags.$$ --exclude=.git "$@" 2>${err_file}; then - mv $GIT_DIR/tags.$$ $GIT_DIR/tags +dir="`git rev-parse --git-dir`" + +trap "rm -f $dir/tags.$$" EXIT +err_file=$dir/ctags.err +if ctags --tag-relative -Rf$dir/tags.$$ --exclude=.git "$@" 2>${err_file}; then + mv $dir/tags.$$ $dir/tags [ -e ${err_file} ] && rm -f ${err_file} else # Ignore STDERR unless `ctags` returned a non-zero exit code