Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Respect $TMPDIR if it exists #1891

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
;;

Expand Down Expand Up @@ -11477,6 +11477,7 @@ EOF
main() {
cache_uname
get_os
get_cache_dir

# Load default config.
eval "$config"
Expand All @@ -11499,7 +11500,6 @@ main() {
}

image_backend
get_cache_dir
old_functions
print_info
dynamic_prompt
Expand Down