-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomrc.sh
52 lines (45 loc) · 1.11 KB
/
customrc.sh
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
CUSTOMRC_SILENT_OUTPUT=false
CUSTOMRC_GLOBAL_IGNORE_LIST=(
)
CUSTOMRC_IGNORE_LIST=(
"cursor.sh"
"iterm.sh"
"jankyborders.sh"
)
is_ignored() {
local item="$1"
local ignoreList=("${@:2}")
for ignore in "${ignoreList[@]}"; do
if [[ "$ignore" == "$item" ]]; then
return 0
fi
done
return 1
}
CUSTOMRC_GLOBAL_RC_PATH="$CUSTOMRC_PATH/Global"
for file in $CUSTOMRC_GLOBAL_RC_PATH/*; do
fileName=$(basename "$file")
if ! is_ignored $fileName $CUSTOMRC_GLOBAL_IGNORE_LIST; then
if [[ -f $file ]]; then
source "$file"
fi
elif [[ "$CUSTOMRC_SILENT_OUTPUT" != true ]]; then
echo "Customrc: ignoring $fileName (global)"
fi
done
CUSTOMRC_RC_PATH="$CUSTOMRC_PATH/$(uname)"
for file in $CUSTOMRC_RC_PATH/*; do
fileName=$(basename "$file")
if ! is_ignored $fileName $CUSTOMRC_IGNORE_LIST; then
if [[ -f $file ]]; then
source "$file"
fi
elif [[ "$CUSTOMRC_SILENT_OUTPUT" != true ]]; then
echo "Customrc: ignoring $fileName"
fi
done
if [[ -f "$(dirname "$0")/fix-prompt-at-bottom.sh" ]]; then
source "$(dirname "$0")/fix-prompt-at-bottom.sh"
fi
fileName=
file=