-
Notifications
You must be signed in to change notification settings - Fork 22
/
bashrc
68 lines (54 loc) · 1.55 KB
/
bashrc
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
#
# .bash_profile - How I configure bash
#
# This is just a skeleton; the real heavy lifting is done by various
# compartmentalized scripts, which are all sourced by this file. Inspired by
# Zach Holman's dotfiles organization.
#
# Author
# Jake Zimmerman <[email protected]>
#
# Usage
# This file requires that many helper files are in place for it to work
# correctly. Read the README for more information.
#
# load a module robustly by skipping all remaining modules if any module fails
# to load
load_module() {
if [ -n "$ABORTED" ]; then
return
fi
module="$1"
if [ -f "$module" ]; then
source $module
if [ "$?" != "0" ]; then
echo "Module $module failed to load. Exiting."
export ABORTED=1
return
fi
fi
}
# Make sure we are running interactively, else stop
[ -z "$PS1" ] && return
# Hacks to override things before starting
load_module ~/.util/before.sh
# Load utility colors
load_module ~/.util/colors.sh
# Remind the user to update and provide mechanism for updating easily
#load_module ~/.util/auto-update.sh
# bash-specific settings
load_module ~/.util/misc.bash
# host-specific settings. This file changes per host according to rcm.
load_module ~/.util/host.sh
# Host-independent aliases
load_module ~/.util/aliases.sh
# host-specific bash settings.
load_module ~/.util/host.bash
# miscellaneous, shell-agnostic settings
load_module ~/.util/misc.sh
# miscellaneous, shell-agnostic settings
load_module ~/.util/prompt.bash
# load helper functions
for module in ~/.util/functions/*.sh; do
load_module $module
done