summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-05-22 15:32:32 +0300
committerPaul Buetow <paul@buetow.org>2025-05-22 15:32:32 +0300
commit34cce2e6f23cda1722e403ad94cbc3384c43e1e6 (patch)
treec40cda766f8bcabfab82a37696c6348d95ac7588
parent6f6d39a0155904e6ca9194de2cb5574855c6fe4b (diff)
Update
-rw-r--r--dotfiles/fish/conf.d/supersync.fish26
1 files changed, 14 insertions, 12 deletions
diff --git a/dotfiles/fish/conf.d/supersync.fish b/dotfiles/fish/conf.d/supersync.fish
index 58d1c00..15d8662 100644
--- a/dotfiles/fish/conf.d/supersync.fish
+++ b/dotfiles/fish/conf.d/supersync.fish
@@ -1,17 +1,5 @@
set -x SUPERSYNC_STAMP_FILE ~/.supersync.last
-function supersync::is_it_time_to_sync
- set -l max_age 86400
- set -l now (date +%s)
- if test -f $SUPERSYNC_STAMP_FILE
- set -l diff (math $now - (cat $SUPERSYNC_STAMP_FILE))
- if test $diff -lt $max_age
- return 0
- end
- end
- echo 'It is time to run sync!!!'
-end
-
# Only sync the HabitsAndQuotes when it's asked for via function parameter
function supersync::worktime
set -l worktime_dir ~/git/worktime
@@ -89,3 +77,17 @@ function supersync
date +%s >$SUPERSYNC_STAMP_FILE.tmp
mv $SUPERSYNC_STAMP_FILE.tmp $SUPERSYNC_STAMP_FILE
end
+
+function supersync::is_it_time_to_sync
+ set -l max_age 86400
+ set -l now (date +%s)
+ if test -f $SUPERSYNC_STAMP_FILE
+ set -l diff (math $now - (cat $SUPERSYNC_STAMP_FILE))
+ if test $diff -lt $max_age
+ return 0
+ end
+ end
+ echo 'It is time to run sync!!!'
+ read -P "Run sync? (y/n) " answer; and test "$answer" = y; and supersync
+end
+read -P "Run sync? (y/n) " answer; and test "$answer" = y; and supersync