Skip to content

Commit

Permalink
Prefer explicit escaping (SC1117)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcambus committed Aug 30, 2017
1 parent 511719b commit a6ec71c
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions ansiweather
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# https://github.com/fcambus/ansiweather #
# #
# Created: 2013-08-29 #
# Last Updated: 2017-06-21 #
# Last Updated: 2017-08-30 #
# #
# AnsiWeather is released under the BSD 2-Clause license. #
# See LICENSE file for details. #
Expand Down Expand Up @@ -123,11 +123,11 @@ timeformat=$(get_config "timeformat" || echo "%b %d %r")

###[ Colors and characters ]###################################################

background=$(get_config "background" || echo "\033[44m")
text=$(get_config "text" || echo "\033[36;1m")
data=$(get_config "data" || echo "\033[33;1m")
delimiter=$(get_config "delimiter" || echo "\033[35m=>")
dashes=$(get_config "dashes" || echo "\033[34m-")
background=$(get_config "background" || echo "\\033[44m")
text=$(get_config "text" || echo "\\033[36;1m")
data=$(get_config "data" || echo "\\033[33;1m")
delimiter=$(get_config "delimiter" || echo "\\033[35m=>")
dashes=$(get_config "dashes" || echo "\\033[34m-")



Expand All @@ -145,15 +145,15 @@ forecast_text=$(get_config "forecast_text" || echo "forecast")

###[ Unicode Symbols for icons ]###############################################

sun=$(get_config "sun" || echo "\033[33;1m\xe2\x98\x80")
moon=$(get_config "moon" || echo "\033[36m\xe2\x98\xbd")
clouds=$(get_config "clouds" || echo "\033[37;1m\xe2\x98\x81")
rain=$(get_config "rain" || echo "\033[37;1m\xe2\x98\x94")
fog=$(get_config "fog" || echo "\033[37;1m\xe2\x96\x92")
mist=$(get_config "mist" || echo "\033[34m\xe2\x96\x91")
haze=$(get_config "haze" || echo "\033[33m\xe2\x96\x91")
snow=$(get_config "snow" || echo "\033[37;1m\xe2\x9d\x84")
thunderstorm=$(get_config "thunderstorm" || echo "\033[33;1m\xe2\x9a\xa1")
sun=$(get_config "sun" || echo "\\033[33;1m\\xe2\\x98\\x80")
moon=$(get_config "moon" || echo "\\033[36m\\xe2\\x98\\xbd")
clouds=$(get_config "clouds" || echo "\\033[37;1m\\xe2\\x98\\x81")
rain=$(get_config "rain" || echo "\\033[37;1m\\xe2\\x98\\x94")
fog=$(get_config "fog" || echo "\\033[37;1m\\xe2\\x96\\x92")
mist=$(get_config "mist" || echo "\\033[34m\\xe2\\x96\\x91")
haze=$(get_config "haze" || echo "\\033[33m\\xe2\\x96\\x91")
snow=$(get_config "snow" || echo "\\033[37;1m\\xe2\\x9d\\x84")
thunderstorm=$(get_config "thunderstorm" || echo "\\033[33;1m\\xe2\\x9a\\xa1")



Expand Down Expand Up @@ -399,7 +399,7 @@ fi

if [ "$ansi" = true ]
then
env printf "$output\033[0m\n"
env printf "$output\\033[0m\\n"
else
env printf "$output\n" | sed "s/$(printf '\033')\[[0-9;]*m//g"
env printf "$output\\n" | sed "s/$(printf '\033')\\[[0-9;]*m//g"
fi

0 comments on commit a6ec71c

Please sign in to comment.