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

View file

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