diff --git a/scripts/weather.sh b/scripts/weather.sh index 26b45f3..70dd310 100755 --- a/scripts/weather.sh +++ b/scripts/weather.sh @@ -53,7 +53,17 @@ display_weather() temperature=$(echo $weather_information | rev | cut -d ' ' -f 1 | rev) # +31°C, -3°F, etc unicode=$(forecast_unicode $weather_condition) - echo "$unicode ${temperature/+/}" # remove the plus sign to the temperature + # Mac Only variant should be transparent on Linux + if [[ "${temperature/+/}" == *"===="* ]]; then + temperature="error" + fi + + if [[ "${temperature/+/}" == "error" ]]; then + # Propagate Error + echo "error" + else + echo "$unicode ${temperature/+/}" # remove the plus sign to the temperature + fi } forecast_unicode() @@ -76,7 +86,7 @@ forecast_unicode() main() { # process should be cancelled when session is killed - if timeout 1 bash -c "