-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaliases.local
More file actions
executable file
·46 lines (35 loc) · 1.12 KB
/
aliases.local
File metadata and controls
executable file
·46 lines (35 loc) · 1.12 KB
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
# Local aliases and functions
__aliases_local_main() {
local SH_SOURCE_FILE SH_SOURCE_DIR SH_SOURCE_FILE_ESCAPED
if [ -n "$ZSH_VERSION" ]; then
SH_SOURCE_FILE=${(%):-%x}
elif [ -n "$BASH_VERSION" ]; then
SH_SOURCE_FILE=${BASH_SOURCE[0]}
fi
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)"
# Early load before dotrc main started
# Late load after dotrc main finished
__aliases_local_load() {
local ALIASES_LOCAL_LOAD
}
}
__aliases_local_main "$@"
unset -f __aliases_local_main