Spaces:
Sleeping
Sleeping
commit
Browse files- validate-submission.sh +8 -1
validate-submission.sh
CHANGED
|
@@ -19,6 +19,13 @@ else
|
|
| 19 |
RED='' GREEN='' YELLOW='' BLUE='' BOLD='' NC=''
|
| 20 |
fi
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
log() { printf "[%s] %b\n" "$(date +%H:%M:%S)" "$*"; }
|
| 23 |
pass() { log "${GREEN}${BOLD}PASS${NC} -- $1"; }
|
| 24 |
fail() { log "${RED}${BOLD}FAIL${NC} -- $1"; }
|
|
@@ -84,7 +91,7 @@ fi
|
|
| 84 |
pass "Environment is ready."
|
| 85 |
|
| 86 |
log "${BOLD}Step 1/3: Pinging HF Space${NC} ($PING_URL/reset) ..."
|
| 87 |
-
HTTP_CODE=$(curl
|
| 88 |
-H "Content-Type: application/json" -d '{}' \
|
| 89 |
"$PING_URL/reset" --max-time 20 || echo "000")
|
| 90 |
|
|
|
|
| 19 |
RED='' GREEN='' YELLOW='' BLUE='' BOLD='' NC=''
|
| 20 |
fi
|
| 21 |
|
| 22 |
+
CURL_ARGS=(-s)
|
| 23 |
+
case "$(uname -s 2>/dev/null || printf unknown)" in
|
| 24 |
+
MINGW*|MSYS*|CYGWIN*)
|
| 25 |
+
CURL_ARGS+=(--ssl-no-revoke)
|
| 26 |
+
;;
|
| 27 |
+
esac
|
| 28 |
+
|
| 29 |
log() { printf "[%s] %b\n" "$(date +%H:%M:%S)" "$*"; }
|
| 30 |
pass() { log "${GREEN}${BOLD}PASS${NC} -- $1"; }
|
| 31 |
fail() { log "${RED}${BOLD}FAIL${NC} -- $1"; }
|
|
|
|
| 91 |
pass "Environment is ready."
|
| 92 |
|
| 93 |
log "${BOLD}Step 1/3: Pinging HF Space${NC} ($PING_URL/reset) ..."
|
| 94 |
+
HTTP_CODE=$(curl "${CURL_ARGS[@]}" -o /dev/null -w "%{http_code}" -X POST \
|
| 95 |
-H "Content-Type: application/json" -d '{}' \
|
| 96 |
"$PING_URL/reset" --max-time 20 || echo "000")
|
| 97 |
|