-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.profile
45 lines (41 loc) · 1019 Bytes
/
.profile
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
# shellcheck disable=SC2148
# load dotfiles that are not bound to a specific shell, namely '.exports', '.aliases' and '.functions'
# load these two optional files:
# * '.path', which is used for extension of your 'path' you don't want to commit
# * '.extra', which is used for other settings you don’t want to commit
# this idea is coming from https://github.com/mathiasbynens/dotfiles/blob/master/.bash_profile#L4-L9
dotfiles="\
${HOME}/.path
${HOME}/.exports
${HOME}/.aliases
${HOME}/.functions
${HOME}/.extra\
"
while read -r file; do
if [ -r "$file" ] && [ -f "$file" ]; then
# shellcheck source=/dev/null
. "$file";
fi
done <<EOF
$dotfiles
EOF
unset dotfiles
# load platform-specific dotfiles
case "$(uname)" in
Darwin*)
dotfiles="\
${HOME}/.exports.macos
${HOME}/.aliases.macos
${HOME}/.functions.macos\
"
while read -r file; do
if [ -r "$file" ] && [ -f "$file" ]; then
# shellcheck source=/dev/null
. "$file";
fi
done <<EOF
$dotfiles
EOF
;;
esac
unset dotfiles