Last active
December 24, 2018 23:13
-
-
Save sampollard/863105c6b25bd9be334a23e2be8b543d to your computer and use it in GitHub Desktop.
Productivity Enhancer
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 | |
# usage: ./prod.sh <repository_url> | |
# Have no one doubt your productivity on GitHub. You must already have | |
# a repository and have an ssh key established for this to work. | |
# To get a nice solid green contribution, see | |
# https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile | |
REPO_URL=$1 | |
git clone "$REPO_URL" ~/prod | |
cd ~/prod | |
if ! [ -f counter.txt ]; then | |
echo 1 > counter.txt | |
git add counter.txt | |
git commit -m "Initial commit" | |
git push | |
fi | |
while [ true ]; do | |
sleep 900 | |
git pull | |
N=$(echo 1 + $(cat counter.txt)|bc) | |
echo $N > counter.txt | |
git add counter.txt | |
msg=$(echo $(curl -s \ | |
http://whatthecommit.com/index.txt) \ | |
| tr -d \"\'$) | |
git commit -m "$msg" | |
git push | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment