From 8193bd631355acf718b1530fcceff0a7509f3537 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 2 Dec 2016 20:39:34 +1100 Subject: [PATCH] Cache: Only cache info if the info exists --- neofetch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 2b671c9f..05493f8b 100755 --- a/neofetch +++ b/neofetch @@ -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() {