commit e7964fd25a9faaf45abaaeaaba0204032612a364
parent 488cc23a3c44c3350729c44f67e810ea8e2c449f
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Fri, 21 Mar 2025 10:39:27 +0100
fix: actually parse a file
Diffstat:
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/fetch_and_rewrite.sh b/fetch_and_rewrite.sh
@@ -137,7 +137,9 @@ if [ -f "${cache_file}.old" ]; then
# replace date in affected line of new file
if [ ! -z $date_line_old ] && [ ! -z $date_line_new ]; then
- old_date=$(awk "NR==$date_line_old" | sed -e 's/^.*=>\s*//')
+ old_date=$(
+ awk "NR==$date_line_old" "${cache_file}.old" | sed -e 's/^.*=>\s*//'
+ )
sed -e "${date_line_new}s/=>[^\/]*/=> ${old_date}/" -i "${cache_file}.new"
fi
@@ -165,7 +167,3 @@ if [ -f "${cache_file}.old" ]; then
fi
mv "${cache_file}.new" "${cache_file}.old"
-
-
-
-