diff --git a/Perso/INTech/gitUpdate.sh b/Perso/INTech/gitUpdate.sh index 629642d..9fb8f76 100755 --- a/Perso/INTech/gitUpdate.sh +++ b/Perso/INTech/gitUpdate.sh @@ -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 localStatus="$(git push -n --porcelain | grep -e'up to date')" # Empty if there are commits to push - { + output=$( if [ -z "$remoteStatus" ]; then if [ -z "$localStatus" ]; then echo "Pushing "$GIT_REPO" updates to origin" @@ -64,8 +64,12 @@ for GIT_REPO in $work_array ; do git remote update 2>&1 exit 1 fi - fi } | wall + fi ) + if [ ! -z "$output" ]; then + echo "$output" | wall + fi + done exit 0 \ No newline at end of file diff --git a/Perso/systemd_timers/gitUpdate.service b/Perso/systemd_timers/gitUpdate.service index a38072d..90e03de 100644 --- a/Perso/systemd_timers/gitUpdate.service +++ b/Perso/systemd_timers/gitUpdate.service @@ -4,4 +4,4 @@ Description=Updates git repos [Service] Type=oneshot User=intech -ExecStart=/bin/bash ~/git_repos/gitUpdate.sh "/home/intech/git_repos/TechTheTachyon-HighLevel.git" "/home/intech/git_repos/TechTheTachyon-LowLevel.git" \ No newline at end of file +ExecStart=/bin/bash /home/intech/git_repos/gitUpdate.sh "/home/intech/git_repos/TechTheTachyon-HighLevel.git" "/home/intech/git_repos/TechTheTachyon-LowLevel.git" \ No newline at end of file