bashrc: built the structure to add utility functions for the bashrc in the future.
This commit is contained in:
parent
6d1f8e626e
commit
d60da53caf
2 changed files with 12 additions and 1 deletions
10
.bashrc
10
.bashrc
|
@ -51,15 +51,23 @@ function true_false_default {
|
||||||
|
|
||||||
export -f truthy falsy true_false_default
|
export -f truthy falsy true_false_default
|
||||||
|
|
||||||
|
# Now that we have the bare essentials, determine if the rest of the configura-
|
||||||
|
# tion should be loaded. DOTFILES_ACTIVE is a environment variable that can be
|
||||||
|
# set in ~/.environment.d/dotfiles.env
|
||||||
if truthy $DOTFILES_ACTIVE; then
|
if truthy $DOTFILES_ACTIVE; then
|
||||||
|
|
||||||
# Source .bashrc.d
|
# Load utilty functions that may be used by other configurations
|
||||||
|
. "$DOTFILES_DIR/bash_functions.sh"
|
||||||
|
|
||||||
|
# Load the rest of the bash configs in ~/.basrc.d
|
||||||
for file in ~/.bashrc.d/*.sh; do
|
for file in ~/.bashrc.d/*.sh; do
|
||||||
. "$file"
|
. "$file"
|
||||||
done
|
done
|
||||||
|
|
||||||
unset -v file
|
unset -v file
|
||||||
|
|
||||||
|
# If the DOTFILES_ACTIVE is not set at all, assume that the dotfiles repo was
|
||||||
|
# cloned very recently and print a friendly reminder.
|
||||||
elif [[ ! -v DOTFILES_ACTIVE ]]; then
|
elif [[ ! -v DOTFILES_ACTIVE ]]; then
|
||||||
echo "Dotfiles environment not found." >&2
|
echo "Dotfiles environment not found." >&2
|
||||||
echo "You should probably reload your login session before proceeding." >&2
|
echo "You should probably reload your login session before proceeding." >&2
|
||||||
|
|
3
.dotfiles/bash_functions.sh
Normal file
3
.dotfiles/bash_functions.sh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function dot_msg {
|
||||||
|
echo "$@"
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue