Skip to content

Instantly share code, notes, and snippets.

@davidyuk
Created February 4, 2021 07:57
Show Gist options
  • Save davidyuk/963529ba417025e4a7647fcea7c3c3de to your computer and use it in GitHub Desktop.
Save davidyuk/963529ba417025e4a7647fcea7c3c3de to your computer and use it in GitHub Desktop.
Simple rebuild and run on the latest commit changing
#!/bin/bash
cd ~/folder-with-git-repository
while true
do
git fetch
git reset --hard origin/master
commit=$(git log -n 1)
if [ "$lastCommit" != "$commit" ]
then
lastCommit=$commit
./build.sh
pkill process-name
./run.sh &
fi
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment