lib/utilities: use `$XDG_CACHE_HOME` properly

We should fall back to the default location, not use an entirely different one.
pull/2061/head
John D Pell 2022-02-18 02:55:54 -08:00
parent 72829ca21d
commit 6257853759
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ function _bash-it-component-help() {
function _bash-it-component-cache-file() { function _bash-it-component-cache-file() {
local _component_to_cache _file_path _result="${2:-${FUNCNAME[0]//-/_}}" local _component_to_cache _file_path _result="${2:-${FUNCNAME[0]//-/_}}"
_bash-it-component-pluralize "${1?${FUNCNAME[0]}: component name required}" _component_to_cache _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%/*}" [[ -f "${_file_path}" ]] || mkdir -p "${_file_path%/*}"
printf -v "${_result?}" '%s' "${_file_path}" printf -v "${_result?}" '%s' "${_file_path}"
} }