sapphrc/usr/bin/sapphrc_updown
Penelope Gwen 0fb8a165d1 v1.2
2024-04-09 00:36:06 -06:00

24 lines
442 B
Bash
Executable file

#!/bin/bash
source /lib/sapphrc/sapphrc-functions
source /lib/sapphrc/sapphrc-font
validate_backupdir
cd "$HOME/.config/sapphrc/backups"
sapphrc_backup
gs="$(git status | grep -i 'modified')"
git fetch origin
reslog=$(git log HEAD..origin/main --oneline)
echo $gs
echo " "
echo $reslog
if [[ "${reslog}" == "" ]];then
#remote changes exist
sapphrc_restore
elif [[ $gs == *"modified"* ]];then
#local changes exist
sapphrc_push
fi
exit