Cache: Only cache info if the info exists

This commit is contained in:
Dylan Araps 2016-12-02 20:39:34 +11:00
parent 99c0abc820
commit 8193bd6313
1 changed files with 4 additions and 2 deletions

View File

@ -2800,8 +2800,10 @@ bar() {
} }
cache() { cache() {
mkdir -p "${cache_dir}/neofetch" if [[ "$2" ]]; then
printf "%s" "${1/*-}=\"$2\"" > "${cache_dir}/neofetch/${1/*-}" mkdir -p "${cache_dir}/neofetch"
printf "%s" "${1/*-}=\"$2\"" > "${cache_dir}/neofetch/${1/*-}"
fi
} }
get_cache_dir() { get_cache_dir() {