From ff5d27dfce6a75cbff57a78cd99c384d2dfa850f Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Wed, 12 Aug 2015 21:07:51 +0200 Subject: [PATCH] Nifty little ctags update script --- bin/update-ctags | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 bin/update-ctags diff --git a/bin/update-ctags b/bin/update-ctags new file mode 100644 index 0000000..cddbe08 --- /dev/null +++ b/bin/update-ctags @@ -0,0 +1,16 @@ +#!/bin/bash +# http://blog.chmouel.com/2009/07/03/update-emacsvim-tags-with-inotify/ +# /home/youruser/workspace/myproject IN_CLOSE_WRITE /home/youruser/bin/update-ctags py $@ $@/$# + +ACCEPTED_EXTENSION="$(echo $1|sed 's/|/ /g')" +BASE_DIR=$2 +FILE_EXT=${3##*.} + +[[ -z ${FILE_EXT} ]] && exit + +processing= +for extension in $ACCEPTED_EXTENSION;do + [[ $extension == $FILE_EXT ]] && processing=true +done + +find ${BASE_DIR} ! -wholename './.git/*' -a ! -wholename './.svn/*' -a ! -name '*.pyc' -a ! -name '*~' -a ! -name '*#' -print0| xargs -0 etags -o ${BASE_DIR}/TAGS 2>/dev/null >/dev/null