Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gitshots for Windows - Gitcam
#!/bin/sh
### gitcam for windows (start) ###
NAME=`date +%Y%m%d%H%M%S`
DIRECTORY="/IMAGES/TARGET/DIRECTORY"
COMMANDCAMDIR="/PATH/TO/COMMANDCAM"
BMP2JPGDIR="/PATH/TO/BMP2PG"
if [ ! -d "$DIRECTORY" ]; then
mkdir $DIRECTORY
fi
$COMMANDCAMDIR/CommandCam //quiet //filename $DIRECTORY/$NAME.bmp
$BMP2JPGDIR/BMP2JPG.exe "$DIRECTORY/$NAME.bmp" "$DIRECTORY/$NAME.jpg" > /dev/null
rm $DIRECTORY/$NAME.bmp
### gitcam for windows (end) ###

Instructions

  1. Download gitcam.sh
  2. Download CommandCam : http://batchloaf.wordpress.com/commandcam/
  3. Download BMP2JPG : http://www.microtom.net/os-management/convert-bmp-to-jpg-command-line-utility
  4. Install this as a post-commit hook in your repo
  5. git config --global init.templatedir '~/.git_template'
  6. mkdir -p ~/.git_template/hooks
  7. echo -e '#!/bin/sh\n/PATH/TO/gitcam.sh' >> ~/.git_template/hooks/post-commit
  8. chmod +x ~/.git_template/hooks/post-commit
  9. Run git init in a repo where you want to use the hook!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment