Modification pour lancer le script et éviter le spam de wall vides
This commit is contained in:
parent
03ea6eafc8
commit
9c881c366e
2 changed files with 7 additions and 3 deletions
|
@ -47,7 +47,7 @@ for GIT_REPO in $work_array ; do
|
||||||
remoteStatus="$(git fetch --dry-run 2>&1 | tail -n 1 | grep -v -e'+')" # Empty if there are no commits to fetch
|
remoteStatus="$(git fetch --dry-run 2>&1 | tail -n 1 | grep -v -e'+')" # Empty if there are no commits to fetch
|
||||||
localStatus="$(git push -n --porcelain | grep -e'up to date')" # Empty if there are commits to push
|
localStatus="$(git push -n --porcelain | grep -e'up to date')" # Empty if there are commits to push
|
||||||
|
|
||||||
{
|
output=$(
|
||||||
if [ -z "$remoteStatus" ]; then
|
if [ -z "$remoteStatus" ]; then
|
||||||
if [ -z "$localStatus" ]; then
|
if [ -z "$localStatus" ]; then
|
||||||
echo "Pushing "$GIT_REPO" updates to origin"
|
echo "Pushing "$GIT_REPO" updates to origin"
|
||||||
|
@ -64,8 +64,12 @@ for GIT_REPO in $work_array ; do
|
||||||
git remote update 2>&1
|
git remote update 2>&1
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi } | wall
|
fi )
|
||||||
|
|
||||||
|
if [ ! -z "$output" ]; then
|
||||||
|
echo "$output" | wall
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
exit 0
|
exit 0
|
|
@ -4,4 +4,4 @@ Description=Updates git repos
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
User=intech
|
User=intech
|
||||||
ExecStart=/bin/bash ~/git_repos/gitUpdate.sh "/home/intech/git_repos/TechTheTachyon-HighLevel.git" "/home/intech/git_repos/TechTheTachyon-LowLevel.git"
|
ExecStart=/bin/bash /home/intech/git_repos/gitUpdate.sh "/home/intech/git_repos/TechTheTachyon-HighLevel.git" "/home/intech/git_repos/TechTheTachyon-LowLevel.git"
|
Loading…
Add table
Reference in a new issue