Last active
December 11, 2015 07:09
-
-
Save mislav/4564682 to your computer and use it in GitHub Desktop.
git post-commit hook to snap an image of you from the webcam
This file contains 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
#!/bin/bash | |
# git post-commit hook to snap an image of your smiling face. | |
set -e | |
[ -n "$GIT_DIR" ] && cd "${GIT_DIR}/.." | |
image_dir="commit_images" | |
image_file="${image_dir}/${USER} $(date '+%Y-%m-%d at %H.%M.%S').jpg" | |
grep "$image_dir" .gitignore &>/dev/null || echo "${image_dir}" >> .gitignore | |
mkdir -p "$(dirname "$image_file")" | |
imagesnap -q "$image_file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment