Skip to content

Commit 9ea77ba

Browse files
committed
refactor: simplify reading colorCodes from color table.txt
1 parent 5cf8e52 commit 9ea77ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

generator.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ else
140140
fi
141141
SH_ECHO
142142
fi
143-
awk '{print $1}' "${table}" | while IFS= read -r color; do
143+
cat "${table}" | while read -r color colorCode; do
144144
# light or not
145145
for light in "" "Light"; do
146146
if [ "${light}" = "" ]; then
@@ -178,7 +178,7 @@ SH_ECHO
178178
echo ""
179179
printf "%s%s" "${echoFunction}" "${brackets}"
180180
# write the code down
181-
echo "${startSym}${echo}"' "\\033['"${finalStyleCode}${code}""$(grep "${color}" "${table}" | awk '{print $2}')"'m$'"${para}"'\\033[m"'"${endSym}"
181+
echo "${startSym}${echo}"' "\\033['"${finalStyleCode}${code}${colorCode}"'m$'"${para}"'\\033[m"'"${endSym}"
182182
} >> "${tempDist}"
183183
fi
184184
done

0 commit comments

Comments
 (0)