]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
gamepack-manager: more reliable extra-urls.txt parsing
authorThomas Debesse <dev@illwieckz.net>
Fri, 24 Jun 2022 22:08:31 +0000 (00:08 +0200)
committerThomas Debesse <dev@illwieckz.net>
Fri, 24 Jun 2022 22:08:31 +0000 (00:08 +0200)
Make it works even when the shell transforms \n from stdin into \r\n
on Windows.

gamepack-manager

index 232c75962dc9ad21a60a937e24cad02c8bc7cbf4..efcb751f94a7056681739ce62e8f2223c339fdea 100755 (executable)
@@ -294,11 +294,12 @@ downloadExtraUrls ()
 {
        if [ -f 'extra-urls.txt' ]
        then
-               while IFS='     ' read -r extra_file extra_url
+               local line
+               while read line
                do
-                       (
-                               ${WGET} -O "${extra_file}" "${extra_url}"
-                       ) </dev/null
+                       local extra_file="$(echo "${line}" | cut -f1 -d$'\t')"
+                       local extra_url="$(echo "${line}" | cut -f2 -d$'\t')"
+                       ${WGET} -O "${extra_file}" "${extra_url}" < /dev/null
                done < 'extra-urls.txt'
        fi
 }