diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-11 08:37:01 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-11 08:37:01 +0300 |
| commit | f3bf0c994fe07affe17b2a60a1d71fd2652c120e (patch) | |
| tree | dcd25e704e2f67b1428385f53dc0e77da0170a4c /fish | |
| parent | 1ab9a49490110d5e26eac2a68dfc1994f4966f73 (diff) | |
Update
Diffstat (limited to 'fish')
| -rw-r--r-- | fish/conf.d/supersync.fish | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/fish/conf.d/supersync.fish b/fish/conf.d/supersync.fish index 75d0c5e..e4154a9 100644 --- a/fish/conf.d/supersync.fish +++ b/fish/conf.d/supersync.fish @@ -27,12 +27,14 @@ function supersync::prompts # Since files might have been added and/or modified withoug being # committed to git yet. if test -d ~/git/dotfiles/prompts + # For my Linux hosts cd ~/git/dotfiles/prompts find . -type f -name \*.md | xargs git add find . -type f -name \*.md | xargs git commit -m 'update prompts' git push cd - else if test -d ~/git/helpers/prompts + # For my Mac host cd ~/git/helpers/prompts find . -type f -name \*.md | xargs git add find . -type f -name \*.md | xargs git commit -m 'update prompts' @@ -41,6 +43,18 @@ function supersync::prompts end 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 + read -P "It's time to run supersync! Run it? (y/n) " answer; and test "$answer" = y; and supersync +end + function supersync if test -f ~/.supersync_disable echo Supersync is disabled @@ -67,16 +81,4 @@ function supersync 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 - read -P "It's time to run supersync! Run it? (y/n) " answer; and test "$answer" = y; and supersync -end - abbr -a supersynct 'supersync; track' |
