From 27221b850fbb694e1430a5c6c34dcdd59622aafb Mon Sep 17 00:00:00 2001 From: MorganGeek Date: Thu, 23 Jul 2020 09:47:45 +0200 Subject: [PATCH] checkenremote: improve github readme url detection --- dot_zsh_functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dot_zsh_functions b/dot_zsh_functions index 3e4e8f9..ee55959 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -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 }