forked from pkopriv2/bashum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.sh
33 lines (29 loc) · 733 Bytes
/
env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# See if bashum_home has been set. If not, assume the standard location.
export bashum_home=${bashum_home:-$HOME/.bashum}
export bashum_repo=${bashum_repo:-$HOME/.bashum_repo}
# add the root bin dir to the path
if ! echo $PATH | grep -q $bashum_home/bin
then
PATH=$bashum_home/bin:$PATH
fi
# add the repo bin dir to the path
if ! echo $PATH | grep -q $bashum_repo/bin
then
PATH=$bashum_repo/bin:$PATH
fi
# source all the bashum environment files
for file in $(ls $bashum_home/env/*.sh 2>/dev/null)
do
if [[ -f $file ]]
then
source $file
fi
done
# source all the environment files in all the packages.
for file in $(ls $bashum_repo/packages/*/env/*.sh 2>/dev/null)
do
if [[ -f $file ]]
then
source $file
fi
done