Skip to content

Commit

Permalink
Fix net downloading script
Browse files Browse the repository at this point in the history
The recent commit introduced a bug in the net downloading script that
the file is not downloaded correctly and the content is redirected to
stdout.

closes official-stockfish#5585

No functional change
  • Loading branch information
MinetaS authored and Disservin committed Sep 10, 2024
1 parent d8e49cd commit f677aee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/net.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

wget_or_curl=$( (command -v wget > /dev/null 2>&1 && echo "wget -q") || \
(command -v curl > /dev/null 2>&1 && echo "curl -L -s -k"))
wget_or_curl=$( (command -v wget > /dev/null 2>&1 && echo "wget -qO-") || \
(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." \
Expand Down Expand Up @@ -51,7 +51,7 @@ fetch_network() {
"https://tests.stockfishchess.org/api/nn/$_filename" \
"https://github.com/official-stockfish/networks/raw/master/$_filename"; do
echo "Downloading from $url ..."
if $wget_or_curl "$url"; then
if $wget_or_curl "$url" > "$_filename"; then
if validate_network "$_filename"; then
echo "Successfully validated $_filename"
else
Expand Down

0 comments on commit f677aee

Please sign in to comment.