-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
51 lines (39 loc) · 1.09 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
#!/bin/bash
function verify_bash() {
# test if shell is bash
if [[ -z "$PS1" ]] || [[ -z "$BASH_VERSION" ]] ; then
echo "ERROR: shell is not BASH" >&2
return 1
fi
# test if file already included
if [[ -n "$workflow_processed_bashrc" ]] ; then
return 1
fi
# test if interactive
if [[ "$-" != *i* ]] ; then
return 1
fi
return 0
}
function verify_profile() {
if [[ -z "$workflow_directories" ]] && [[ -f $HOME/.profile ]] ; then
. "$HOME"/.profile
fi
}
function bashrc() {
local status=0
verify_bash || return 0
workflow_processed_bashrc=true
verify_profile || status=$(( status + 1 ))
workflow_includes=".bashrc.d bashrc.d"
for dir in $workflow_directories ; do
for inc in $workflow_includes ; do
workflow_include_directory "$dir/$inc"
done
done
unset -f verify_bash setup_colors setup_completion setup_history \
setup_includes setup_path setup_ssh setup_x11 \
setup_applications bashrc
return $status
}
bashrc "$@" || return $?