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() {
# check if online
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}/"
cd "$path"
@ -15,10 +16,13 @@ notesSync() {
git add .
git commit -m "[bash script] update/add entries" >> /dev/null
git push --quiet
echo ">>> Sync success"
} || {
# Report; TODO: write log
echo ">>> Sync failed"
}
else
echo ">>> Sync skipped due to timeout ($time)"
fi
}