From 85d88f7d74cef7fd798cd7b5b3fa8f29f0fa99cf Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 4 Jun 2025 22:44:44 +0300 Subject: [PATCH] Handle missing weather data --- .local/bin/print-status | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.local/bin/print-status b/.local/bin/print-status index 8601d84..bc818d5 100755 --- a/.local/bin/print-status +++ b/.local/bin/print-status @@ -36,6 +36,11 @@ case "${battery_state}" in ;; esac -weather=$(cat /tmp/weather-report.txt) +weather_file="/tmp/weather-report.txt" +if [ -f ${weather_file} ]; then + weather=$(cat ${weather_file}) +else + weather="" +fi echo ${weather} 📆${today} ⏲${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}%