Ensure .profile is loaded by shells.

Took this code out of /etc/profile and /etc/bashrc from NixOS
This commit is contained in:
Andrew R. M 2018-01-04 18:35:09 -05:00
parent 1739eb4ecc
commit bb11db42a5
2 changed files with 15 additions and 4 deletions

View File

@ -29,22 +29,29 @@ export PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_C
#{- SOURCING -}#
# Source aliases
# Source profile, if it hasn't already been loaded
if [ -z "$__PROFILE_DONE" ]; then
. $HOME/.profile
fi
# Source aliases, if they exist
if [ -f "$HOME/.aliases" ] && [ -r "$HOME/.aliases" ]; then
. "$HOME/.aliases"
fi
# Source private aliases
# Source private aliases, if they exist
if [ -f "$HOME/.private_aliases" ] && [ -r "$HOME/.private_aliases" ]; then
. "$HOME/.private_aliases"
fi
# Source functions
# Source functions, if they exist
if [ -f "$HOME/.functions" ] && [ -r "$HOME/.functions" ]; then
. "$HOME/.functions"
fi
# Source private functions
# Source private functions, if they exist
if [ -f "$HOME/.private_functions" ] && [ -r "$HOME/.private_functions" ]; then
. "$HOME/.private_functions"
fi

View File

@ -1,5 +1,9 @@
#{- ~/.profile -}#
# Only execute this file once per shell
if [ -n "$__PROFILE_SOURCED" ]; then return; fi
export __PROFILE_SOURCED=1
#{- PATH -}#
# Prepend ~/.local/bin to the path and append the current directory to the path