diff --git a/Makefile b/Makefile index 93148db..d97ad07 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ test: bash_unit ./tests/test_*.sh +runtests: + ls -1 zk tests/* | entr -c bash_unit ./tests/test_*.sh install: test -d ~/.local/bin/ || mkdir -p ~/.local/bin/ cp zk ~/.local/bin/zk diff --git a/zk b/zk index c9f6df6..ba72737 100755 --- a/zk +++ b/zk @@ -63,6 +63,20 @@ _zk_edit() { fi } +_zk_rm() { + if test -z "$1"; then + echo "zk rm: no zettel id given" 1>&2 + exit 1 + fi + + if ! find "$ZKDIR" -name "$1" | grep .; then + echo "zk rm: zettel "$1" not found" 1>&2 + exit 2 + fi + + rm "$ZKDIR/$1" +} + main() { check_zkdir