From 126325d598a10cfc5776b90f16ec09f12bc1531b Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sun, 9 Jan 2022 20:54:51 -0800 Subject: [PATCH] zsh: fix for having no docs repo or todo symlink --- .zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 05ef2cb..e7bd779 100644 --- a/.zshrc +++ b/.zshrc @@ -23,7 +23,7 @@ export ZINIT_HOME_DIR="${XDG_DATA_HOME:-$HOME/.local}/share/zinit" # Set documents directory (auto set to the repo the file ~/todo points to is in) - export DOCS_DIR="$(git -C "$(dirname "$(realpath ~/todo)")" rev-parse --show-toplevel | head -1)" + [ -h ~/todo ] && export DOCS_DIR="$(git -C "$(dirname "$(realpath ~/todo)" 2>&1)" rev-parse --show-toplevel | head -1)" # Don't add extra space to the right side of the prompt ZLE_RPROMPT_INDENT=0