-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbash_init
51 lines (39 loc) · 885 Bytes
/
bash_init
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
os=$1
cpu=$2
repo=$3
if [[ -z ${os} || -z ${cpu} || -z ${repo} ]]; then
echo 1>&2 "Incorrect arguments given to bash_profile; os: $os cpu: $cpu repo: $repo"
exit 1
fi
if [[ -d ${repo}/shared/bash ]]; then
pushd ${repo}/shared/bash >/dev/null
for filepath in *; do
if [[ -f ${filepath} ]]; then
. ${filepath}
fi
done
popd >/dev/null
fi
if [[ -d ${repo}/${os}/bash ]]; then
pushd ${repo}/${os}/bash >/dev/null
for filepath in *; do
if [[ -f ${filepath} ]]; then
. ${filepath}
fi
done
popd >/dev/null
fi
if [[ -d ${repo}/${os}-${cpu}/bash ]]; then
pushd ${repo}/${os}-${cpu}/bash >/dev/null
for filepath in *; do
if [[ -f ${filepath} ]]; then
. ${filepath}
fi
done
popd >/dev/null
fi
# extras that shouldn't be in the dot-files repo
if [ -f ~/.bash_extras ]; then
. ~/.bash_extras
fi