Skip to content

Commit

Permalink
check once and exit instead of looping
Browse files Browse the repository at this point in the history
Some users may prefer to schedule git repository checks at set times rather than checking continuously (to reduce hits on remote servers for instance). With this patch, if git-dude's check interval set to 0, the script exits after a single check. Then, using systemd timers in Linux or launchd launch agents in OS X, git-dude runs can be scheduled as desired.
  • Loading branch information
tekdoc committed Jan 24, 2018
1 parent 54ae1f0 commit cfc40ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions git-dude
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ while true; do
fi
done
fi

sleep $interval
if [ "$interval" = "0" ]; then
exit 0
else
sleep $interval
fi
done

0 comments on commit cfc40ab

Please sign in to comment.