Respect $TMPDIR
if it exists
This commit is contained in:
parent
aa026545b9
commit
765b03643d
1 changed files with 7 additions and 7 deletions
14
neofetch
14
neofetch
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue