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