Skip to content

Instantly share code, notes, and snippets.

@DelphicOkami
Last active June 20, 2017 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DelphicOkami/6dab198713bc5b79ff1a18e0b94a84f4 to your computer and use it in GitHub Desktop.
Save DelphicOkami/6dab198713bc5b79ff1a18e0b94a84f4 to your computer and use it in GitHub Desktop.
lolcommit postcommit for per-commit capture
#!/bin/bash
# This script depends on lolcommits and slack up being installed
# Slackup https://github.com/rkhleics/slackup (pip install slackup)
# Lolcommits https://lolcommits.github.io/
# This file should be in .git/hooks/ and be made executable
exec < /dev/tty
SLACK_CHANNEL="lolcommits"
if [ "${LOLCOMMITS_DISABLED}" != "true" ] && [ ! -d "$GIT_DIR/rebase-merge" ]; then
read -p "Do you want to lolcommit that? " -n 1 LOLCOMMIT
echo
if [[ "${LOLCOMMIT}" =~ ^[Yy]$ ]]; then
LANG="en_GB.UTF-8" && PATH="/usr/local/bin:/usr/local/bin:$PATH" lolcommits --capture
read -p "Do you want to slack that lolcommit? " -n 1 SLACKUP
echo
if [[ "${SLACKUP}" =~ ^[Yy]$ ]]; then
slackup "#${SLACK_CHANNEL}" "$(ls ~/.lolcommits/${PWD##*/}/$(git rev-parse HEAD | cut -c1-11).*)"
fi
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment