checkenremote: improve github readme url detection

This commit is contained in:
MorganGeek 2020-07-23 09:47:45 +02:00
parent a31870d764
commit 27221b850f

View File

@ -326,6 +326,10 @@ function checkenlist() {
function checkenremote() {
local target_url=$(echo "$1" | sed 's/github.com/raw.githubusercontent.com/g' | sed 's;blob/;;')
if [[ "$target_url" =~ "githubusercontent.com" && ! "$target_url" =~ "README" ]]; then
target_url=$(echo "$target_url/master/README.md")
fi
arrow "checking $target_url"
curl --location --insecure --silent "$target_url" > /tmp/file && checkenlist /tmp/file && write-good --no-passive /tmp/file && proselint /tmp/file && \cat /tmp/file > alex -q --stdin
}