/etc/profile: Also source profile.d/*.sh files in data dirs
This allows packages to place files in data/profile.d to manipulate the shell environment. They could already use settings/etc/profile.d, but since there's no point in editing those files in most cases, placing them there nonetheless doesn't make much sense.
This commit is contained in:
parent
5760191f1f
commit
be012e2122
@ -106,6 +106,16 @@ function dir {
|
||||
ls -lF "$@";
|
||||
}
|
||||
|
||||
for dir in `findpaths -Re B_FIND_PATH_DATA_DIRECTORY profile.d 2> /dev/null`; do
|
||||
for i in $dir/*.sh; do
|
||||
if [ -r $i ]; then
|
||||
. $i
|
||||
fi
|
||||
done
|
||||
unset i
|
||||
done
|
||||
unset dir
|
||||
|
||||
if [ -d /etc/profile.d ]; then
|
||||
for i in /etc/profile.d/*.sh; do
|
||||
if [ -r $i ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user