feat(notes): prompt sync status
This commit is contained in:
parent
3de358e878
commit
059a164a50
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue