Skip to content

Commit 7fce07f

Browse files
add generator script
1 parent 772fa20 commit 7fce07f

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

β€Žgen.shβ€Ž

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
3+
dist=colorEcho.sh
4+
5+
echo '#!/usr/bin/env bash' > $dist
6+
7+
for color in `cat table | awk '{print $1}'`
8+
do
9+
for light in "" "Light"
10+
do
11+
if [ "$light" = "" ]; then
12+
code=3
13+
else
14+
code=9
15+
fi
16+
for bold in "" "Bold"
17+
do
18+
if [ "$bold" = "" ]; then
19+
bCode=
20+
else
21+
bCode='1;'
22+
fi
23+
for underLine in "" "UL"
24+
do
25+
echo "" >> $dist
26+
echo "function echo.$light$bold$underLine$color()" >> $dist
27+
if [ "$underLine" = "" ]; then
28+
ulCode=
29+
else
30+
ulCode='4;'
31+
fi
32+
echo "{" >> $dist
33+
echo ' echo -e "\e['"$ulCode$bCode$code"$(grep $color table | awk '{print $2}')'m$1\e[m"' >> $dist
34+
echo "}" >> $dist
35+
done
36+
done
37+
done
38+
done

0 commit comments

Comments
Β (0)