Created
June 28, 2021 22:05
-
-
Save KyWa/0aec6804ea8ba2355e858f45967e926f to your computer and use it in GitHub Desktop.
basic git check
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 | |
repodir="/home/user/repo" | |
check_git() { | |
cd $repodir | |
current="cat .git/FETCH_HEAD | awk '{print $1}'" | |
git pull | |
pulled="cat .git/FETCH_HEAD | awk '{print $1}'" | |
if [ $current = $pulled ];then | |
do_thing | |
else | |
exit | |
fi | |
} | |
do_thing() { | |
podman build | |
do yo thang | |
} | |
check_git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment