From 39bbfa7624fa8b09348a07d644c355c5bf4b3966 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 22 Jul 2025 08:20:20 +0300 Subject: Update --- dotfiles/fish/conf.d/supersync.fish | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dotfiles/fish/conf.d/supersync.fish b/dotfiles/fish/conf.d/supersync.fish index 8a4713d..f268512 100644 --- a/dotfiles/fish/conf.d/supersync.fish +++ b/dotfiles/fish/conf.d/supersync.fish @@ -65,8 +65,22 @@ function supersync::taskwarrior end function supersync::gitsyncer - if test -f ~/.gitsyncer_enable - ~/go/bin/gitsyncer sync bidirectional + set enable_file ~/.gitsyncer_enable + set now (date +%s) + set weekly_interval (math 7 \* 24 \* 60 \* 60) + + if not test -f $enable_file + echo $now >$enable_file + else + set last_run (cat $enable_file) + if test (math $now - $last_run) -lt $weekly_interval + return + end + end + + ~/go/bin/gitsyncer sync bidirectional + if test $status -eq 0 + date +%s >$enable_file end end -- cgit v1.2.3