Skip to content

Commit

Permalink
fix: Avoid undesired error message if the last_update_run file is inc…
Browse files Browse the repository at this point in the history
…orrect during news check (#218)

This commit avoids undesired ` [: : integer expression expected` error message in case the `last_update_run` file is incorrect (e.g. it does not contain a properly formatted date) during the news check.
  • Loading branch information
Antiz96 authored Jul 19, 2024
1 parent da04ba1 commit 408078e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/script/arch-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ list_news() {

i=1
while IFS= read -r line; do
if [ -z "${news_option}" ] && [ "${news_dates["${i}-1"]}" -ge "$(date -d "$(cat "${statedir}/last_update_run" 2> /dev/null)" +%s)" ]; then
if [ -z "${news_option}" ] && [ "${news_dates["${i}-1"]}" -ge "$(date -d "$(cat "${statedir}/last_update_run" 2> /dev/null)" +%s)" ] 2> /dev/null; then
new_tag="$(eval_gettext "[NEW]")"
echo -e "${i} - ${line} ${green}${new_tag}${color_off}"
else
Expand Down

0 comments on commit 408078e

Please sign in to comment.