Created
December 15, 2012 17:52
-
-
Save mribica/4297617 to your computer and use it in GitHub Desktop.
Gitshot post-commit hook (Ubuntu)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
puts "[Cheese!]" | |
# Get some info about current commit | |
repository_name = `basename "$PWD"`.chop | |
commit_hash, commit_date = `git log -1 --pretty="%H%n%ci"`.split(/\r?\n/) | |
# Capture image and save it to ~/Pictures/gitshots/REPOSITORYNAME-TIMESTAMP-COMMITHASH.jpeg | |
exec "streamer -c /dev/video0 -b 16 -o ~/Pictures/gitshots/#{repository_name}_#{commit_date.gsub!(' ', '_')}_#{commit_hash}.jpeg" | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment