Last active
June 20, 2017 15:28
-
-
Save DelphicOkami/6dab198713bc5b79ff1a18e0b94a84f4 to your computer and use it in GitHub Desktop.
lolcommit postcommit for per-commit capture
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 | |
# 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