From 156e99cc0ba1b7cd324fd3ed632670b7a5651d0d Mon Sep 17 00:00:00 2001 From: John D Pell Date: Thu, 3 Feb 2022 18:18:21 -0800 Subject: [PATCH] lib/utilities: use `$XDG_CACHE_HOME` properly We should fall back to the default location, not use an entirely different one. --- lib/utilities.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utilities.bash b/lib/utilities.bash index cc178a74b0..2ae09a68e6 100644 --- a/lib/utilities.bash +++ b/lib/utilities.bash @@ -127,7 +127,7 @@ function _bash-it-component-help() { function _bash-it-component-cache-file() { local _component_to_cache _file_path _result="${2:-${FUNCNAME[0]//-/_}}" _bash-it-component-pluralize "${1?${FUNCNAME[0]}: component name required}" _component_to_cache - _file_path="${XDG_CACHE_HOME:-${BASH_IT?}/tmp/cache}${XDG_CACHE_HOME:+/bash_it}/${_component_to_cache?}" + _file_path="${XDG_CACHE_HOME:-${HOME?}/.cache}/bash/${_component_to_cache?}" [[ -f "${_file_path}" ]] || mkdir -p "${_file_path%/*}" printf -v "${_result?}" '%s' "${_file_path}" } @@ -213,7 +213,7 @@ function _bash-it-component-item-is-enabled() { component_type="${1}" item_name="${2}" fi - for each_file in "${BASH_IT}/enabled"/*"${BASH_IT_LOAD_PRIORITY_SEPARATOR?}${item_name}.${component_type}"*."bash" \ + for each_file in "${BASH_IT?}/enabled"/*"${BASH_IT_LOAD_PRIORITY_SEPARATOR?}${item_name}.${component_type}"*."bash" \ "${BASH_IT}/${component_type}"*/"enabled/${item_name}.${component_type}"*."bash" \ "${BASH_IT}/${component_type}"*/"enabled"/*"${BASH_IT_LOAD_PRIORITY_SEPARATOR?}${item_name}.${component_type}"*."bash"; do [[ -f "${each_file}" ]] && return