Skip to content

Instantly share code, notes, and snippets.

@edavis10
Created November 14, 2011 21:07
Show Gist options
  • Save edavis10/1365168 to your computer and use it in GitHub Desktop.
Save edavis10/1365168 to your computer and use it in GitHub Desktop.
Rebuild emacs TAGS on git checkout
#!/usr/bin/env ruby
# put in .git/hooks/post-checkout
# Ruby + JavaScript files - tmp files
files = (Dir['**/**.rb'] + Dir['**/**.js']).
delete_if {|f| f.match(/tmp\//) }.
delete_if {|f| f.match(/vendor\/local/) }
system("ctags -f TAGS -e --languages=-all,+ruby,+javascript #{files.join(' ')}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment