Skip to content

Commit

Permalink
Replace color code with corresponding variable
Browse files Browse the repository at this point in the history
  • Loading branch information
urbanware-org committed Jan 28, 2021
1 parent 41bd5ce commit 9bff1cd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ print_arg_list() {
echo -e "$char_line_double\c"
done

echo -e "\e[0m\n"
echo -e "${cl_n}\n"
echo -e "With the given information, the command line would look like" \
"this (without"
echo -e "'${cl_lc}--dialog${cl_n}' or '${cl_lc}--interactive${cl_n}'" \
Expand Down
8 changes: 4 additions & 4 deletions core/output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -470,16 +470,16 @@ print_output_line() {
line=$(sed -e "s/^$color_code//g" <<< "$output")
output=$(sed -e "s/\\\e\[.*//g" <<< "$line")
random_colors "$output"
elif [ "$color_code" = "\e[0m" ] && [ $highlight_all -eq 0 ]; then
elif [ "$color_code" = "${cl_n}" ] && [ $highlight_all -eq 0 ]; then
if [ $leading_line_char -eq 1 ]; then
echo -e "\e[0m${char_line_leading} $line\e[0m"
echo -e "${cl_n}${char_line_leading} $line${cl_n}"
else
echo -e "\e[0m${line}\e[0m"
echo -e "${cl_n}${line}${cl_n}"
fi
else
if [ $leading_line_char -eq 1 ]; then
if [ $leading_line_char_colored -eq 1 ]; then
echo -e "${color_code}$char_line_leading $output"
echo -e "${color_code}$char_line_leading $output"
else
echo -e "$char_line_leading $output"
fi
Expand Down
8 changes: 4 additions & 4 deletions snippets/confetti.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ confetti() {
if [ $highlight_random -eq 1 ]; then
color_highlight=$(shuf -i 0-1 -n 1)
if [ $color_highlight -eq 1 ]; then
color_char="\e[48;5;${color_confetti}m${char}\e[0m"
color_char="\e[48;5;${color_confetti}m${char}${cl_n}"
else
color_char="\e[38;5;${color_confetti}m${char}\e[0m"
color_char="\e[38;5;${color_confetti}m${char}${cl_n}"
fi
else
if [ $highlight -eq 1 ]; then
color_char="\e[48;5;${color_confetti}m${char}\e[0m"
color_char="\e[48;5;${color_confetti}m${char}${cl_n}"
else
color_char="\e[38;5;${color_confetti}m${char}\e[0m"
color_char="\e[38;5;${color_confetti}m${char}${cl_n}"
fi
fi
line_output="${line_output}${color_char}"
Expand Down
8 changes: 4 additions & 4 deletions testrun/testrun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ echo \
' | |/ _ \/ __| __| '\''__| | | | '\''_ \ / __| __/ _'\'' | __| | | / __|'
echo ' | | __/\__ \ |_| | | |_| | | | | \__ \ || (_| | |_| |_| \__ \'
echo ' |_|\___||___/\__|_| \__,_|_| |_| |___/\__\__,_|\__|\__,_|___/'
echo -e "\e[0m"
echo -e "${cl_n}"
echo " Testrun finished."
if [ $salomon_status -eq 0 ]; then
echo -e " Overall status: \e[92mSuccessfully passed\e[0m"
echo -e " Overall status: \e[92mSuccessfully passed${cl_n}"
else
echo -e " Overall status: \e[91mFailed\e[0m (at least one test)"
echo -e " Overall status: \e[91mFailed${cl_n} (at least one test)"
fi
echo
echo -e "For details see the file \e[96m$salomon_testrun_log\e[0m."
echo -e "For details see the file \e[96m$salomon_testrun_log${cl_n}."
echo
exit $salomon_status

Expand Down

0 comments on commit 9bff1cd

Please sign in to comment.