From 070c35ab0c583d6f393b803eb64934c442203e47 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Sun, 19 Sep 2021 23:23:23 -0700 Subject: [PATCH] lib/utilities: XDG_CACHE_HOME Use $XDG_CACHE_HOME environment constant instead of placing a tmp/cache folder inside the bash-it data repo. If not defined, fall back to current behavior. --- lib/utilities.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utilities.bash b/lib/utilities.bash index 84fa4d96..e9d6591e 100644 --- a/lib/utilities.bash +++ b/lib/utilities.bash @@ -85,8 +85,8 @@ function _bash-it-component-help() { function _bash-it-component-cache-file() { local component file - component="$(_bash-it-pluralize-component "${1}")" - file="${BASH_IT?}/tmp/cache/${component}" + component="$(_bash-it-pluralize-component "${1?}")" + file="${XDG_CACHE_HOME:-${BASH_IT?}/tmp/cache}${XDG_CACHE_HOME:+/bash_it}/${component}" [[ -f "${file}" ]] || mkdir -p "${file%/*}" printf '%s' "${file}" }