Respect $TMPDIR if it exists

This commit is contained in:
Kid 2021-08-29 11:46:33 +08:00 committed by Kid
parent aa026545b9
commit 765b03643d

View file

@ -4807,10 +4807,11 @@ cache() {
}
get_cache_dir() {
case $os in
"Mac OS X"|"macOS") cache_dir="/Library/Caches" ;;
*) cache_dir="/tmp" ;;
esac
if [[ "$TMPDIR" ]]; then
cache_dir="$TMPDIR"
else
cache_dir="/tmp"
fi
}
kde_config_dir() {
@ -5363,8 +5364,7 @@ get_args() {
"--gap") gap="$2" ;;
"--clean")
[[ -d "$thumbnail_dir" ]] && rm -rf "$thumbnail_dir"
rm -rf "/Library/Caches/neofetch/"
rm -rf "/tmp/neofetch/"
rm -rf "$cache_dir/neofetch/"
exit
;;
@ -11477,6 +11477,7 @@ EOF
main() {
cache_uname
get_os
get_cache_dir
# Load default config.
eval "$config"
@ -11499,7 +11500,6 @@ main() {
}
image_backend
get_cache_dir
old_functions
print_info
dynamic_prompt