Delay check for curl/wget until really needed

closes https://github.com/official-stockfish/Stockfish/pull/5938

No functional change
This commit is contained in:
Michel Van den Bergh
2025-03-22 09:58:47 +01:00
committed by Disservin
parent 12d023ed06
commit 6028264cb9

View File

@@ -3,11 +3,6 @@
wget_or_curl=$( (command -v wget > /dev/null 2>&1 && echo "wget -qO-") || \ wget_or_curl=$( (command -v wget > /dev/null 2>&1 && echo "wget -qO-") || \
(command -v curl > /dev/null 2>&1 && echo "curl -skL")) (command -v curl > /dev/null 2>&1 && echo "curl -skL"))
if [ -z "$wget_or_curl" ]; then
>&2 printf "%s\n" "Neither wget or curl is installed." \
"Install one of these tools to download NNUE files automatically."
exit 1
fi
sha256sum=$( (command -v shasum > /dev/null 2>&1 && echo "shasum -a 256") || \ sha256sum=$( (command -v shasum > /dev/null 2>&1 && echo "shasum -a 256") || \
(command -v sha256sum > /dev/null 2>&1 && echo "sha256sum")) (command -v sha256sum > /dev/null 2>&1 && echo "sha256sum"))
@@ -47,6 +42,12 @@ fetch_network() {
fi fi
fi fi
if [ -z "$wget_or_curl" ]; then
>&2 printf "%s\n" "Neither wget or curl is installed." \
"Install one of these tools to download NNUE files automatically."
exit 1
fi
for url in \ for url in \
"https://tests.stockfishchess.org/api/nn/$_filename" \ "https://tests.stockfishchess.org/api/nn/$_filename" \
"https://github.com/official-stockfish/networks/raw/master/$_filename"; do "https://github.com/official-stockfish/networks/raw/master/$_filename"; do