Skip to content

Commit 9b40508

Browse files
feat: retry if download fails
1 parent f6bbbc1 commit 9b40508

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

mediawiki/scripts/install_extensions.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@ declare -a extension_names=( \
1919
)
2020

2121
function fetch_extension_url() {
22-
curl -s "https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=$1&extdistversion=$2" \
23-
| grep -oP 'https://extdist.wmflabs.org/dist/extensions/.*?.tar.gz' \
24-
| head -1
22+
url_page=$(curl -s "https://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdistname=$1&extdistversion=$2")
23+
24+
if [[ "$!" != "0" ]];
25+
then
26+
echo $url_page | grep -oP 'https://extdist.wmflabs.org/dist/extensions/.*?.tar.gz' | head -1
27+
else
28+
echo "Extension version page download failed. Retrying in 1s."
29+
sleep 1
30+
31+
fetch_extension_url "$@"
32+
fi
2533
}
2634

2735
function fetch_skin_url() {

0 commit comments

Comments
 (0)