mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-13 10:40:29 +03:00
gradlew-fdroid: fix parsing when files have Windows linefeeds
The new test file should have Windows linefeeds, if I got the git config correct.
This commit is contained in:
parent
fc885c9b5c
commit
7a84679b0d
3 changed files with 14 additions and 0 deletions
|
|
@ -168,6 +168,7 @@ for f in {.,..}/gradle/wrapper/gradle-wrapper.properties; do
|
|||
if [[ $line == 'distributionUrl='* ]]; then
|
||||
wrapper_ver=${line#*/gradle-}
|
||||
wrapper_ver=${wrapper_ver%-*.zip}
|
||||
wrapper_ver=$(printf $wrapper_ver | tr -d '\r') # strip Windows linefeeds
|
||||
break 2
|
||||
fi
|
||||
done < $f
|
||||
|
|
@ -186,9 +187,11 @@ for f in {.,..}/build.gradle{,.kts}; do
|
|||
if [[ -z "$plugin_pver" && $line == *'com.android.tools.build:gradle:'* ]]; then
|
||||
plugin_pver=${line#*[\'\"]com.android.tools.build:gradle:}
|
||||
plugin_pver=${plugin_pver%[\'\"]*}
|
||||
plugin_pver=$(printf $plugin_pver | tr -d '\r') # strip Windows linefeeds
|
||||
elif [[ -z "$wrapper_ver" && $line == *'gradleVersion = '* ]]; then
|
||||
wrapper_ver=${line#*gradleVersion*=*[\'\"]}
|
||||
wrapper_ver=${wrapper_ver%[\'\"]*}
|
||||
wrapper_ver=$(printf $wrapper_ver | tr -d '\r') # strip Windows linefeeds
|
||||
fi
|
||||
done < $f
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue