diff options
author | Erich Eckner <git@eckner.net> | 2023-08-18 08:46:55 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2023-08-18 08:46:55 +0200 |
commit | 6c0f3bb67ac4fd1fb71b35834f14e72e1b74c7b0 (patch) | |
tree | 470fe3816ba6e63ce8e20529b2fea6474b56dd6b | |
parent | fd29c532d1e757cb0db24ac09910423dee274ada (diff) | |
download | computer-time-limit-6c0f3bb67ac4fd1fb71b35834f14e72e1b74c7b0.tar.xz |
auto-update
-rwxr-xr-x | computer-time-limit | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/computer-time-limit b/computer-time-limit index 87ee9d1..6fb89c9 100755 --- a/computer-time-limit +++ b/computer-time-limit @@ -1,5 +1,7 @@ #!/bin/bash +dir=$(dirname "$(readlink -e "${0}")") + lock_file=~/.computer-time-limit.lock exec 9> "${lock_file}" @@ -7,6 +9,14 @@ if ! flock -n 9; then exit fi +if [ -d "${dir}"'/.git' ] && [ $# -eq 0 ]; then + git -C "${dir}" fetch --all -p 2>/dev/null + if [ -n "$(git -C "${dir}" status --porcelain)" ]; then + git -C "${dir}" pull --ff-only 2>/dev/null + exec "$0" '-' + fi +fi + time_file=~/.computer-time-limit time_per_week=$((3*60*60)) max_time=$((4*60*60)) |