From c87ae4bb5dabe545e9fb5e9516f3e0e84b915345 Mon Sep 17 00:00:00 2001 From: dylan Date: Sun, 28 Feb 2016 00:17:09 +1100 Subject: [PATCH 1/2] Don't create a config file in stdout mode. --- fetch | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fetch b/fetch index 0dc12799..5b7446dd 100755 --- a/fetch +++ b/fetch @@ -2185,9 +2185,6 @@ getconfig () { return fi - # Make the directory if it doesn't exist - mkdir -p "$HOME/.config/fetch/" - # Check $HOME/.config/fetch and create the # dir/files if they don't exist. if [ -f "$HOME/.config/fetch/config" ]; then @@ -2217,9 +2214,6 @@ case "$@" in ;; esac -# If config files are enabled -[ "$config" == "on" ] && getconfig - # }}} @@ -2469,6 +2463,11 @@ done # Restore cursor and clear screen on ctrl+c trap 'printf "\033[?25h"; clear; exit' 2 +if [ "$config" == "on" ]; then + mkdir -p "$HOME/.config/fetch/" + getconfig +fi + # Get colors / bold colors bold From 21c5a5870bfb75b8c8ed6d7dfb89ed7acb2e8db9 Mon Sep 17 00:00:00 2001 From: dylan Date: Sun, 28 Feb 2016 00:18:21 +1100 Subject: [PATCH 2/2] Don't create a config file in stdout mode. --- fetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch b/fetch index 5b7446dd..a582a197 100755 --- a/fetch +++ b/fetch @@ -2435,7 +2435,7 @@ while [ "$1" ]; do unset info_color colors case "$2" in "--"* | "") echo "--stdout requires at least one argument"; exit ;; - *) shift; args=("$@"); stdout ;; + *) shift; args=("$@"); config="off" stdout ;; esac ;;