Skip to content

Commit 36d1e2b

Browse files
committed
lib/utilities: use $XDG_CACHE_HOME properly
We should fall back to the default location, not use an entirely different one.
1 parent aa37f22 commit 36d1e2b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/utilities.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function _bash-it-component-help() {
127127
function _bash-it-component-cache-file() {
128128
local _component_to_cache _file_path _result="${2:-${FUNCNAME[0]//-/_}}"
129129
_bash-it-component-pluralize "${1?${FUNCNAME[0]}: component name required}" _component_to_cache
130-
_file_path="${XDG_CACHE_HOME:-${BASH_IT?}/tmp/cache}${XDG_CACHE_HOME:+/bash_it}/${_component_to_cache?}"
130+
_file_path="${XDG_CACHE_HOME:-${HOME?}/.cache}/bash/${_component_to_cache?}"
131131
[[ -f "${_file_path}" ]] || mkdir -p "${_file_path%/*}"
132132
printf -v "${_result?}" '%s' "${_file_path}"
133133
}
@@ -213,7 +213,7 @@ function _bash-it-component-item-is-enabled() {
213213
component_type="${1}" item_name="${2}"
214214
fi
215215

216-
for each_file in "${BASH_IT}/enabled"/*"${BASH_IT_LOAD_PRIORITY_SEPARATOR?}${item_name}.${component_type}"*."bash" \
216+
for each_file in "${BASH_IT?}/enabled"/*"${BASH_IT_LOAD_PRIORITY_SEPARATOR?}${item_name}.${component_type}"*."bash" \
217217
"${BASH_IT}/${component_type}"*/"enabled/${item_name}.${component_type}"*."bash" \
218218
"${BASH_IT}/${component_type}"*/"enabled"/*"${BASH_IT_LOAD_PRIORITY_SEPARATOR?}${item_name}.${component_type}"*."bash"; do
219219
[[ -f "${each_file}" ]] && return

0 commit comments

Comments
 (0)