From: Jon Schewe Date: Mon, 10 Oct 2011 01:44:29 +0000 (-0500) Subject: Remove error message when enabled directory is empty X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=7d18cccae949bb3ba088edb195ba9232ee204369;p=common%2Fbash_it.git Remove error message when enabled directory is empty This is fixed by checking if the file exists before trying to source it. --- diff --git a/bash_it.sh b/bash_it.sh index fd7b546..bfa6664 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -14,7 +14,9 @@ source "${BASH}/themes/base.theme.bash" LIB="${BASH}/lib/*.bash" for config_file in $LIB do - source $config_file + if [ -e "${config_file}" ]; then + source $config_file + fi done # Load enabled aliases, completion, plugins @@ -27,7 +29,9 @@ do FILES="${BASH}/${file_type}/enabled/*.bash" for config_file in $FILES do - source $config_file + if [ -e "${config_file}" ]; then + source $config_file + fi done done @@ -41,7 +45,9 @@ fi CUSTOM="${BASH}/custom/*.bash" for config_file in $CUSTOM do - source $config_file + if [ -e "${config_file}" ]; then + source $config_file + fi done