diff options
| author | Paul Buetow <paul@buetow.org> | 2025-07-22 08:20:20 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-07-22 08:20:20 +0300 |
| commit | 39bbfa7624fa8b09348a07d644c355c5bf4b3966 (patch) | |
| tree | 977426986b88042e24e86da1565552ba465ba7bc | |
| parent | c60c88a4c0edc47be88a11cfe8cd8162cb4ece7f (diff) | |
Update
| -rw-r--r-- | dotfiles/fish/conf.d/supersync.fish | 18 |
1 files 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 |
