diff options
| author | Marc Cornellà <marc@mcornella.com> | 2024-06-20 19:51:51 +0200 |
|---|---|---|
| committer | Marc Cornellà <marc@mcornella.com> | 2024-06-20 19:51:51 +0200 |
| commit | a87e9c715b2d3249681f9cc8f8d9718030674d50 (patch) | |
| tree | 6ea5406a33e0187723b3fdff84dc9d388732797c /oh-my-zsh.sh | |
| parent | c432ca09932bb0c2f2f7f8862b949b0875615724 (diff) | |
| download | zsh-a87e9c715b2d3249681f9cc8f8d9718030674d50.tar.gz zsh-a87e9c715b2d3249681f9cc8f8d9718030674d50.tar.bz2 zsh-a87e9c715b2d3249681f9cc8f8d9718030674d50.zip | |
fix(init): fix definition order for `$ZSH_CUSTOM`
Tipped about this in https://github.com/ohmyzsh/ohmyzsh/commit/6754b7e67#commitcomment-143280115
Diffstat (limited to 'oh-my-zsh.sh')
| -rw-r--r-- | oh-my-zsh.sh | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 9660f93c9..694095afa 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -48,13 +48,15 @@ omz_f() { unset -f omz_f # If ZSH is not defined, use the current script's directory. -[[ -z "$ZSH" ]] && export ZSH="${${(%):-%x}:a:h}" +[[ -n "$ZSH" ]] || export ZSH="${${(%):-%x}:a:h}" + +# Set ZSH_CUSTOM to the path where your custom config files +# and plugins exists, or else we will use the default custom/ +[[ -n "$ZSH_CUSTOM" ]] || ZSH_CUSTOM="$ZSH/custom" # Set ZSH_CACHE_DIR to the path where cache files should be created # or else we will use the default cache/ -if [[ -z "$ZSH_CACHE_DIR" ]]; then - ZSH_CACHE_DIR="$ZSH/cache" -fi +[[ -n "$ZSH_CACHE_DIR" ]] || ZSH_CACHE_DIR="$ZSH/cache" # Make sure $ZSH_CACHE_DIR is writable, otherwise use a directory in $HOME if [[ ! -w "$ZSH_CACHE_DIR" ]]; then @@ -76,12 +78,6 @@ fpath=($ZSH/{functions,completions} $ZSH_CUSTOM/{functions,completions} $fpath) # Load all stock functions (from $fpath files) called below. autoload -U compaudit compinit zrecompile -# Set ZSH_CUSTOM to the path where your custom config files -# and plugins exists, or else we will use the default custom/ -if [[ -z "$ZSH_CUSTOM" ]]; then - ZSH_CUSTOM="$ZSH/custom" -fi - is_plugin() { local base_dir=$1 local name=$2 |
