From 8675ad9ff2421e634b3fae2b132e7e6a99fc41a9 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Fri, 20 Dec 2024 22:10:10 +0100 Subject: [PATCH] chore: Optimize news path parsing when listing Arch news The command historically used for news path parsing was chaining multiple 'sed' calls in an unoptimized way. Everything is now merged into a single 'sed' call. --- src/lib/list_news.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/list_news.sh b/src/lib/list_news.sh index 038aa51..a465947 100755 --- a/src/lib/list_news.sh +++ b/src/lib/list_news.sh @@ -69,7 +69,7 @@ else if [ "${num}" -le "${news_num}" ] 2> /dev/null && [ "${num}" -gt "0" ]; then printed_news="true" news_selected=$(sed -n "${num}"p <<< "${news_titles}") - news_path=$(echo "${news_selected}" | sed s/\ -//g | sed s/\ /-/g | sed s/[.]//g | sed s/=//g | sed s/\>//g | sed s/\//g -e s/\