zsh: add auto syncing powers to todo()
This commit is contained in:
parent
77317c2dfd
commit
298ab38131
1 changed files with 2 additions and 1 deletions
3
.zshrc
3
.zshrc
|
@ -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"
|
||||||
|
|
Loading…
Add table
Reference in a new issue