zsh: add auto syncing powers to todo()

This commit is contained in:
PowerUser64 2021-09-20 10:48:25 -07:00
parent 77317c2dfd
commit 298ab38131

3
.zshrc
View file

@ -161,7 +161,7 @@
# a simple way to manage your todo list # a simple way to manage your todo list
# Usage: # Usage:
# todo -- edit ~/todo # todo -- pull latest repo version and edit ~/todo
# todo auto -- commit and push ~/todo with message 'todo' # todo auto -- commit and push ~/todo with message 'todo'
# todo [any git command] -- manage todo for easy syncing, assuming ~/todo is # todo [any git command] -- manage todo for easy syncing, assuming ~/todo is
# a symlink that points to a file in a git repo # a symlink that points to a file in a git repo
@ -174,6 +174,7 @@
todo_dir="$(dirname "$(realpath ~/todo)")" todo_dir="$(dirname "$(realpath ~/todo)")"
if [ -z "$@" ];then if [ -z "$@" ];then
cd "$(dirname "$(realpath ~/todo)")" cd "$(dirname "$(realpath ~/todo)")"
git pull
$EDITOR ~/todo $EDITOR ~/todo
elif [ "$@" = 'auto' ];then elif [ "$@" = 'auto' ];then
cd "$todo_dir" cd "$todo_dir"