-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathload
More file actions
32 lines (28 loc) · 815 Bytes
/
load
File metadata and controls
32 lines (28 loc) · 815 Bytes
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
# vim: ft=zsh sw=2 ts=2 expandtab
# A simple log function which helps debug
# complex setups
function ls_log {
# log MSG - logs a message when debug is enabled
if [[ -n ${LOAD_SHELL_DEBUG} ]]; then
tput -Txterm setaf 5 >&2
echo -e "ls_log: ${*}" >&2
tput -Txterm sgr0 >&2
fi
}
# Will source files recursively only ignoring .git directories.
function source_files() {
if [[ -d ${1} ]]; then
for file in $(find -s ${1} -type f | \grep -vE '/.git' ); do
ls_log "loading ${file}"
source ${file}
done
fi
}
# this file patch
current_path=${0:A:h}
# First couple of general helpers
source_files "${current_path}/common"
# Actual configs and functions
source_files "${current_path}/configs"
# Specific configs with non-public information
source_files "${current_path}/private"