Last active
June 16, 2024 11:37
-
-
Save Mtillmann/c25c17f4edb3ee3408e440ad4a25e94c to your computer and use it in GitHub Desktop.
automatically push homes(h)ick castles when they have changes
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
#!/usr/bin/bash | |
# crontab -e | |
# 1 */2 * * * /home/martin/push-homesick-castles.sh dotfiles > /dev/null 2>&1 | |
if [ $# -eq 0 ] | |
then | |
echo "Usage $0 castle1[, castle2, castle3, ...]" | |
exit 1 | |
fi | |
for castle in "$@" | |
do | |
cd "$HOME/.homesick/repos/$castle" | |
if [ -n "$(git status --porcelain)" ] | |
then | |
git add . | |
git commit -am "committed by push-homesick-castles.sh at $(date)" | |
git push | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment