diff --git a/.config/shell/env b/.config/shell/env index 6a3b169..a6f7a7c 100644 --- a/.config/shell/env +++ b/.config/shell/env @@ -33,13 +33,13 @@ 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) -if [ -h ~/todo ]; then +if [ -h ~/todo ] && command -v git > /dev/null; then # shellcheck disable=SC2155 export DOCS_DIR="$(git -C "$(dirname "$(realpath ~/todo)" 2>&1)" rev-parse --show-toplevel | head -1)" elif [ -d "$HOME/Documents/docs" ]; then export DOCS_DIR="$HOME/Documents/docs/" else - echo "Error: couldn't find the documents repo" >&2 + echo "Error: couldn't find the documents repo" > /dev/null fi ## Working directory save settings (see things at bottom of zshrc)