diff --git a/.config/shell/env b/.config/shell/env index 893f36c..6a3b169 100644 --- a/.config/shell/env +++ b/.config/shell/env @@ -5,7 +5,7 @@ export SHELL_CONFIG_DIR="${SHELL_CONFIG_DIR:-"${XDG_CONFIG_HOME:-"$HOME/.config"}/shell"}" if ! [ -d "$SHELL_CONFIG_DIR" ]; then - echo "FATAL ERROR: \$SHELL_CONFIG_DIR is not set to a real directory: $SHELL_CONFIG_DIR" + echo "FATAL ERROR: \$SHELL_CONFIG_DIR is not set to a real directory: $SHELL_CONFIG_DIR" >&2 fi # Intelligently set $EDITOR @@ -33,8 +33,14 @@ 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) -# shellcheck disable=SC2155 -[ -h ~/todo ] && export DOCS_DIR="$(git -C "$(dirname "$(realpath ~/todo)" 2>&1)" rev-parse --show-toplevel | head -1)" || DOCS_DIR="$HOME/Documents/docs/" +if [ -h ~/todo ]; 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 +fi ## Working directory save settings (see things at bottom of zshrc) WORKING_DIR_SAVE_FILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/last-working-dir"