zsh: split off functions now contain a note about use

This commit is contained in:
PowerUser64 2022-01-02 17:46:16 -08:00
parent 11ef75c22e
commit e8064cfac3
5 changed files with 11 additions and 6 deletions

View file

@ -1,4 +1,5 @@
#!/bin/bash
# Source this and then run `todo`
# a simple way to manage your todo list
# Usage:
@ -9,12 +10,13 @@
# Suggested use: make a git repo for holding your todo list, then make
# a symlink called 'todo' that points to your todo list in your home directory
#
todo() {
todo_dir="$(dirname "$(realpath ~/todo)")"
todo_file="$(realpath ~/todo)"
if [ -z "$*" ];then
( # subshell to protect against directory changes
cd "$todo_dir" || exit
cd "$todo_dir" || return
# pull the latest commits
git rev-parse &&
@ -31,7 +33,7 @@ todo() {
)
elif [ "$*" = "cd" ]; then
cd "$todo_dir" || exit
cd "$todo_dir" || return
else
git -C "$todo_dir" $@
fi