-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zsh.loader
54 lines (34 loc) · 1.12 KB
/
dot_zsh.loader
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
52
53
54
#!/bin/bash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
source_zsh_files() {
declare -r CURRENT_DIRECTORY="$(pwd)"
declare -r -a FILES_TO_SOURCE=(
".zsh.aliases"
".zsh.functions"
".zsh.exports"
# for local settings that should
# not be under version control
".zsh.local"
)
local file=""
local i=""
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# for i in ${!FILES_TO_SOURCE[*]}; do
for i in ${FILES_TO_SOURCE[@]}; do
file="$HOME/$i"
# echo "sourcing $file..."
[ -r "$file" ] \
&& . "$file"
done
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cd "$CURRENT_DIRECTORY"
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
source_zsh_files
unset -f source_zsh_files
# Remove duplicated entries
typeset -U PATH
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Clear system messages (system copyright notice, the date
# and time of the last login, the message of the day, etc.).
# clear