mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-26 17:54:14 +00:00
changed to make only a single call to curl per link
This commit is contained in:
parent
5f1592fa7a
commit
8735757c93
14
.github/workflows/testPatches.sh
vendored
14
.github/workflows/testPatches.sh
vendored
@ -22,15 +22,20 @@ for file in "$wikiDirectory"/*.md; do
|
||||
do
|
||||
if [[ $line =~ $patchRE ]]; then
|
||||
extractedURL=${BASH_REMATCH[0]}
|
||||
patchAccessResult=$(curl -s -w "%{http_code}" -o /dev/null "$extractedURL")
|
||||
if [ "$patchAccessResult" -ne 200 ]; then
|
||||
response=$(curl -s -w "%{http_code}" -o - "$extractedURL")
|
||||
|
||||
http_status_code="${response: -3}"
|
||||
patchContent="${response:0:-3}"
|
||||
|
||||
if [ "$http_status_code" -ne 200 ] || [ -z "$patchContent" ]; then
|
||||
echo "⚠️ - $extractedURL"
|
||||
update_line "$line" "inaccessible"
|
||||
continue
|
||||
fi
|
||||
|
||||
git -C "$dwlSrcDirectory" apply --check <(curl -s "$extractedURL") > /dev/null 2>&1
|
||||
git -C "$dwlSrcDirectory" apply --check <<< "$patchContent" > /dev/null 2>&1
|
||||
patchApplicationExitCode=$?
|
||||
|
||||
if [ $patchApplicationExitCode -eq 0 ]; then
|
||||
echo "✅ - $extractedURL"
|
||||
update_line "$line" "pass"
|
||||
@ -38,10 +43,7 @@ for file in "$wikiDirectory"/*.md; do
|
||||
echo "❌ - $extractedURL"
|
||||
update_line "$line" "fail"
|
||||
fi
|
||||
|
||||
fi
|
||||
done < "$file"
|
||||
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user