Skip to content

Commit

Permalink
Maintain old behavior regarding DIRENV_CONFIG
Browse files Browse the repository at this point in the history
Only use ~/.config/direnv if DIRENV_CONFIG is not set
  • Loading branch information
infinisil committed Oct 12, 2022
1 parent 3f6363d commit f106329
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions stdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@ DIRENV_LOG_FORMAT="${DIRENV_LOG_FORMAT-direnv: %s}"

# Where direnv configuration should be stored
IFS=: xdg_config_dirs=( ${XDG_CONFIG_DIRS:-/etc/xdg} )
xdg_config_dirs+=( "${XDG_CONFIG_HOME:-$HOME/.config}" )

declare -a direnv_config_dirs
for dir in "${xdg_config_dirs[@]}"; do
direnv_config_dirs+=( "$dir/direnv" )
done
if [[ -n "$DIRENV_CONFIG" ]]; then
direnv_config_dirs+=( "$DIRENV_CONFIG" )
fi
direnv_config_dirs+=( "${DIRENV_CONFIG:-${XDG_CONFIG_HOME:-$HOME/.config}/direnv}" )

# This variable can be used by programs to detect when they are running inside
# of a .envrc evaluation context. It is ignored by the direnv diffing
Expand Down

0 comments on commit f106329

Please sign in to comment.