Skip to content

Commit

Permalink
fix profile.d problems
Browse files Browse the repository at this point in the history
  • Loading branch information
saltedcoffii committed Mar 27, 2021
1 parent d57ea5c commit bd05c1b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/profile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# Instead, add custom environment variables to env.d/99-custom and
# custom scripting to profile.d/99-custom

# Source the base /etc/profile file
source /etc/profile

# Find system configuration directory
SYSCONFDIR="$(crew const CREW_PREFIX | sed -e 's:CREW_PREFIX=::g')/etc"

Expand All @@ -13,12 +16,17 @@ set +h
# Load the environment
for i in "${SYSCONFDIR}"/env.d/*; do source "${i}"; done

# Load the profile
if [ -d ${SYSCONFDIR}/profile.d ]; then
for i in "${SYSCONFDIR}"/profile.d/*.sh; do source "${i}"; done
fi

# Load the bash directory
if [ ! -z "${BASH}" ]; then
for i in "${SYSCONFDIR}"/bash.d/*; do source "${i}"; done
fi

# Load the zsh directory
if [ ! -z "${ZSH_NAME}" ]; then
for i in "${SYSCONFDIR}"/bash.d/*; do source "${i}"; done
for i in "${SYSCONFDIR}"/zsh.d/*; do source "${i}"; done
fi

0 comments on commit bd05c1b

Please sign in to comment.