You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
430 B

#!/usr/bin/env bash
# inspired by https://tbaggery.com/2011/08/08/effortless-ctags-with-git.html
set -o errexit
main() {
local git_dir
git_dir="$(git rev-parse --git-dir)"
local tmp_tags
tmp_tags="$(mktemp)"
trap 'rm -f "${tmp_tags}"' EXIT
git ls-files |
ctags \
--tag-relative \
-L - \
-f"${tmp_tags}" \
--languages=-javascript,sql
mv "${tmp_tags}" "${git_dir}/tags"
}
main "${@}"