Skip to content

Instantly share code, notes, and snippets.

@kzkn
Last active March 27, 2018 14:12
Show Gist options
  • Save kzkn/c15ac3ae5b778a0ff3db81c0b540564c to your computer and use it in GitHub Desktop.
Save kzkn/c15ac3ae5b778a0ff3db81c0b540564c to your computer and use it in GitHub Desktop.
#!/bin/sh
clean=0
rails=0
while getopts rc OPT
do
case $OPT in
r) rails=1 ;;
c) clean=1 ;;
esac
done
if [ $rails = 1 ]; then
ctags -f TAGS_APP --languages=ruby -e -R app spec
else
ctags -f TAGS_APP --languages=ruby -e -R
fi
[ $clean = 1 ] && rm -f TAGS_LIB
[ -f TAGS_LIB ] || (bundle show --paths | xargs ctags -a -f TAGS_LIB --languages=ruby -e -R)
cat TAGS_APP TAGS_LIB >TAGS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment