zk: Check WIKIROOT before adding n alias for zk

Since this function also requires a WIKIROOT to be available in the
environment, we should only define it if that variable is not empty --
just like all the other zk aliases and functions.
This commit is contained in:
Marty Oehme 2025-12-10 09:32:14 +01:00
parent 6aa8aefe0e
commit cf544e4740
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -1,5 +1,7 @@
#!/usr/bin/env sh
#
# We have a local wiki
if [ -n "${WIKIROOT}" ]; then
_zk_wiki() {
zk --working-dir="$WIKIROOT" "$@"
@ -13,8 +15,6 @@ n() {
fi
}
# We have a local wiki
if [ -n "${WIKIROOT}" ]; then
# open notes with my vim zettelkasten plugin
# TODO better implementation conditional on zk.nvim & zettelkasten existing
# nvim +'lua pcall(require "zk.commands"') --headless +qa 2>&1 or similar to check - but slow