Skip to content

Commit

Permalink
fix(zsh:env): add fallback file path when setting env DOTDIR
Browse files Browse the repository at this point in the history
  ## what
  - add fallback file path when setting env DOTDIR

  ## how

  ## why
  - when running `.zshenv` in a `~/.config/zsh` directory, it's not in a
    git repo, so the command would fail

  ## where
  - ./tools/zsh/.zshenv

  ## usage

  ## issue or pull request
  • Loading branch information
Clumsy-Coder committed Jan 31, 2024
1 parent 199d054 commit 47cf4a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/zsh/.zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export XDG_CACHE_HOME="$HOME/.cache" # Where user-specific non-essential
# -------------------------------------------------------------------------------------------------#

# DIRECTORIES
export DOTDIR=$(git rev-parse --show-toplevel) # used by zshenv and ansible (to link files, etc)
export DOTDIR=$(git rev-parse --show-toplevel 2> /dev/null || echo "$HOME/dotfiles") # used by zshenv and ansible (to link files, etc)
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
export ZSCRIPTDIR="$DOTDIR/tools/zsh"
export HISTFILE="$XDG_STATE_HOME/zsh/history" # history
Expand Down

0 comments on commit 47cf4a9

Please sign in to comment.