Created
May 20, 2024 17:41
-
-
Save BlinkyStitt/ac57759e76b3d8675e212312c1e122fc to your computer and use it in GitHub Desktop.
~/.git-hooks/post-commit
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
#!/bin/bash | |
echo "π§ Breath in. π§ Breath out. π§ Say cheese! π" | |
# Directory to store images and repo names | |
STORAGE_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Documents/Gitshots" | |
# Ensure the storage directory exists | |
mkdir -p "$STORAGE_DIR" | |
# Get the name of the repository | |
REPO_NAME=$(basename "$(git rev-parse --show-toplevel)") | |
IMAGE_PATH="$STORAGE_DIR/${REPO_NAME}-$(date +%Y-%m-%d-%H%M%S).png" | |
# Take a photo with timestamp | |
echo "Saving image to ${IMAGE_PATH}" | |
imagesnap "${IMAGE_PATH}" >/dev/null & | |
# Continue the commit | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment