-
Notifications
You must be signed in to change notification settings - Fork 1
/
bashrc_local
executable file
·56 lines (43 loc) · 1.26 KB
/
bashrc_local
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
# Source local definitions
__bashrc_local_main() {
local SH_SOURCE_FILE SH_SOURCE_DIR SH_SOURCE_FILE_ESCAPED
SH_SOURCE_FILE=${BASH_SOURCE[0]}
while [[ -L "$SH_SOURCE_FILE" ]]; do
SH_SOURCE_FILE=$(readlink "$SH_SOURCE_FILE")
done
SH_SOURCE_DIR=$(dirname "$SH_SOURCE_FILE")
SH_SOURCE_DIR=`cd "$SH_SOURCE_DIR" >/dev/null; pwd`
SH_SOURCE_FILE=$(basename "$SH_SOURCE_FILE")
SH_SOURCE_FILE_ESCAPED=${SH_SOURCE_FILE// /_}
# SH_SOURCE_DIR is a full path to the location of this script
eval "$(cat <<EOF
__get_${SH_SOURCE_FILE_ESCAPED}_dir() {
echo $SH_SOURCE_DIR
}
__get_${SH_SOURCE_FILE_ESCAPED}_file() {
echo $SH_SOURCE_FILE
}
EOF
)"
eval "$(__sh_color_definitions)"
eval "$(__sh_os_definitions)"
local SH_INTERACTIVE
case $- in
*i*)
# interactive shell
SH_INTERACTIVE=1
;;
esac
eval "
__bashrc_local() {
echo $(__get_${SH_SOURCE_FILE_ESCAPED}_dir)'/'$(__get_${SH_SOURCE_FILE_ESCAPED}_file)
}
"
# Early load before dotrc main started
# Late load after dotrc main finished
__bashrc_local_run() {
local BASHRC_LOCAL_RUN
}
}
__bashrc_local_main "$@"
unset -f __bashrc_local_main