-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_config_concatenation.sh
executable file
·53 lines (44 loc) · 1.09 KB
/
bash_config_concatenation.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
#!/usr/bin/env bash
SERVER_VERSION="$1"
SELF=${0%/*}
FILES="$SELF/bash.bashrc"
#add git prompt
if [ "$SERVER_VERSION" ]; then
if [ -f /usr/lib/git-core/git-sh-prompt ]; then
FILES+=" /usr/lib/git-core/git-sh-prompt"
elif [ -f /usr/share/git/completion/git-prompt.sh ]; then
FILES+=" /usr/share/git/completion/git-prompt.sh"
elif [ -f /usr/share/git/completion/git-prompt.sh ]; then
FILES+=" /usr/share/git/git-prompt.sh"
else
echo "No git prompt" >&2
fi
fi
for FILE in $SELF/bash.d/*.sh; do
if [[ $FILE =~ (zoxide|remark).sh ]]; then
continue
fi
FILES+=" $FILE"
done
echo "#"
echo "# Generated at $(date)"
echo "# Version: $(git describe 2>/dev/null || git sha1)"
echo "# From https://github.com/azat/dot_files"
echo "#"
echo
for FILE in $(echo $FILES); do
echo
echo "# Begining of $FILE"
echo "# {{{"
echo
if [ "$SERVER_VERSION" ]; then
# Replace colors of user name in prompt to underlined
cat $FILE | \
sed 's/currentUserColor=$BRed/currentUserColor=$URed/' | \
sed 's/currentUserColor=$BGreen/currentUserColor=$UGreen/'
else
cat $FILE
fi
echo
echo "# }}}"
done