feat(notes): prompt sync status

This commit is contained in:
ayo 2026-04-09 01:13:29 +02:00
parent 3de358e878
commit 059a164a50

View file

@ -7,7 +7,8 @@ dlob=$(tput sgr0)
notesSync() { notesSync() {
# check if online # check if online
test="git.sr.ht" test="git.sr.ht"
if timeout 0.5 ping -q -c 1 -W 1 $test >/dev/null; then time="0.5"
if timeout $time ping -q -c 1 -W 1 $test >/dev/null; then
{ {
path="${notes_dir}/" path="${notes_dir}/"
cd "$path" cd "$path"
@ -15,10 +16,13 @@ notesSync() {
git add . git add .
git commit -m "[bash script] update/add entries" >> /dev/null git commit -m "[bash script] update/add entries" >> /dev/null
git push --quiet git push --quiet
echo ">>> Sync success"
} || { } || {
# Report; TODO: write log # Report; TODO: write log
echo ">>> Sync failed" echo ">>> Sync failed"
} }
else
echo ">>> Sync skipped due to timeout ($time)"
fi fi
} }