Remove error message when enabled directory is empty
authorJon Schewe <jpschewe@mtu.net>
Mon, 10 Oct 2011 01:44:29 +0000 (20:44 -0500)
committerJon Schewe <jpschewe@mtu.net>
Mon, 10 Oct 2011 01:44:29 +0000 (20:44 -0500)
This is fixed by checking if the file exists before trying to source it.

bash_it.sh

index fd7b546..bfa6664 100644 (file)
@@ -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