30 lines
535 B
Bash
Executable file
30 lines
535 B
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
# SCRIPT NAME:
|
|
# sync-notes
|
|
#
|
|
# AUTHOR:
|
|
# Severin Kaderli <severin@kaderli.dev>
|
|
#
|
|
# DESCRIPTION:
|
|
# Sync notes in ~/Notes using git
|
|
#
|
|
# USAGE:
|
|
# ./sync-notes
|
|
. /home/severin/.local/bin/utils
|
|
|
|
if [ ! -d "/home/severin/notes" ]; then
|
|
exit
|
|
fi
|
|
|
|
print_time_log "sync-notes" "Synchronizing notes"
|
|
|
|
if [ "${IS_WORK}" = "1" ]; then
|
|
export GIT_SSH_COMMAND="ssh -i /home/severin/.ssh/severin_id_rsa"
|
|
fi
|
|
|
|
cd "/home/severin/notes" || exit
|
|
git pull
|
|
git add --all
|
|
git commit -s -m "Update notes"
|
|
git push origin master
|