-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_profile
70 lines (58 loc) · 1.5 KB
/
.bash_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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return ;;
esac
[ -z "$PS1" ] && return
if [ -f "${HOME}/.dotfiles.pre.local" ]; then
# shellcheck disable=SC1091
source "${HOME}/.dotfiles.pre.local"
fi
# Location of this repository
REPO_ROOT="${HOME}/dev"
# Locations containing files *.bash to be sourced to your environment
configFileLocations=(
"${REPO_ROOT}/dotfiles/shell"
"${REPO_ROOT}/dotfiles-private/shell"
)
# set default umask
umask 002
# Build PATH
_myPaths=(
"${HOME}/.local/bin"
"/usr/local/bin"
"/opt/homebrew/bin"
"${HOME}/bin"
)
for _path in "${_myPaths[@]}"; do
if [[ -d ${_path} ]]; then
if ! printf "%s" "${_path}" | grep -q "${PATH}"; then
PATH="${_path}:${PATH}"
fi
fi
done
### SOURCE BASH PLUGINS ###
for configFileLocation in "${configFileLocations[@]}"; do
if [ -d "${configFileLocation}" ]; then
while read -r configFile; do
# shellcheck disable=SC1090
source "${configFile}"
done < <(find "${configFileLocation}" \
-maxdepth 1 \
-type f \
-name '*.bash' \
-o -name '*.sh' \
| sort)
fi
done
# Always list directory contents upon 'cd'.
# (Somehow this always failed when I put it in a sourced file)
cd() {
builtin cd "$@" || return
ll
}
if [ -f "${HOME}/.dotfiles.post.local" ]; then
# shellcheck disable=SC1091
source "${HOME}/.dotfiles.post.local"
fi