From 8d3be0d424379a0d7f85c2c5b2655de4ff9b6ae0 Mon Sep 17 00:00:00 2001 From: nick Date: Mon, 24 Feb 2025 18:05:45 -0500 Subject: [PATCH] fixed carriage return included in autocomp.js causing the script to fail loading in browser. files (ex: songs and speeches) that contains crlf line endings caused `gather_lists.sh` to include cr in the generated json/js. i added a sed command to remove cr from song/speeches names. --- misc/gen/autocomp.js | 4 ++-- scripts/gather_lists.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/gen/autocomp.js b/misc/gen/autocomp.js index 8cca6e60..46740d94 100644 --- a/misc/gen/autocomp.js +++ b/misc/gen/autocomp.js @@ -2054,8 +2054,8 @@ content = { ], 'Verlieren_German': [ - "Verlieren ", - "By Eva Simon ", + "Verlieren", + "By Eva Simon", "[speech]", ], diff --git a/scripts/gather_lists.sh b/scripts/gather_lists.sh index 7358d75b..16226834 100755 --- a/scripts/gather_lists.sh +++ b/scripts/gather_lists.sh @@ -9,14 +9,14 @@ echo 'content = {' for i in songs/*/README.md; do echo echo " '$i': [" | sed 's@/README.md@@' | sed 's@songs/@@' - grep '#' $i | head -n 3 | sed 's/"/\\"/g' | sed 's/^#* */ "/' | sed 's/$/",/' + grep '#' $i | head -n 3 | sed -e 's/"/\\"/g' -e 's/^#* */ "/' -e 's/$/",/' -e 's/\r//' echo ' ],' done for i in speeches/*.md; do echo echo " '$i': [" | sed 's@speeches/@@' | sed 's/.md//' - grep '#' $i | head -n 2 | sed 's/^#* */ "/' | sed 's/$/",/' + grep '#' $i | head -n 2 | sed -e 's/^#* */ "/' -e 's/$/",/' -e 's/\r//' echo ' "[speech]",' echo ' ],' done