commit 490294dcc8a3f941980ad59d948ce0228deb0012
parent e8309347c4b7a7b1022d979b5b89c186215f17a6
Author: Byron Torres <b@torresjrjr>
Date: Thu, 18 Feb 2021 02:52:54 +0000
Test for local files before sourcing them
Diffstat:
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/bash/.bashrc b/bash/.bashrc
@@ -28,4 +28,5 @@ alias rs='clear; source $DOTSHELL/bash/.bashrc'
## Local
-source "$DOTSHELL/local/.bashrc"
+test -f "$DOTSHELL/local/.bashrc" &&
+ source "$DOTSHELL/local/.bashrc"
diff --git a/sh/.profile b/sh/.profile
@@ -25,7 +25,8 @@ export LESSHISTFILE="$XDG_CACHE_HOME/less/lesshst"
## Local
-source "$DOTSHELL/local/.profile"
+test -f "$DOTSHELL/local/.profile" &&
+ source "$DOTSHELL/local/.profile"
## Runtime
diff --git a/sh/.shrc b/sh/.shrc
@@ -44,7 +44,8 @@ runtime_print() {
## Local
-source "$DOTSHELL/local/.shrc"
+test -f "$DOTSHELL/local/.shrc" &&
+ source "$DOTSHELL/local/.shrc"
## Runtime
diff --git a/zsh/.zshrc b/zsh/.zshrc
@@ -39,7 +39,8 @@ alias rs='clear; source $DOTSHELL/zsh/.zshrc' # overwrites
## Local
-source "$DOTSHELL/local/.zshrc"
+test -f "$DOTSHELL/local/.zshrc" &&
+ source "$DOTSHELL/local/.zshrc"
## Misc