File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 INSTALL_DIR="$HOME/minecraft-server-$MC_VERSION-$SERVER_TYPE"
4444
4545 echo "🌐 Fetching server JAR URL for version $MC_VERSION and type $SERVER_TYPE..."
46- SERVER_JAR_URL=$(curl -s "https://mcutils.com/api/v1/jars?version=$MC_VERSION&type=$SERVER_TYPE" | jq -r '.url')
46+ API_RESPONSE=$(curl -s "https://mcutils.com/api/v1/jars?version=$MC_VERSION&type=$SERVER_TYPE")
47+
48+ # Debug: Print the raw API response
49+ echo "API Response : $API_RESPONSE"
50+
51+ # Validate JSON using jq
52+ if echo "$API_RESPONSE" | jq empty; then
53+ SERVER_JAR_URL=$(echo "$API_RESPONSE" | jq -r '.url')
54+ else
55+ echo "❌ Error : Invalid JSON response from API."
56+ exit 1
57+ fi
4758
4859 if [ "$SERVER_JAR_URL" == "null" ] || [ -z "$SERVER_JAR_URL" ]; then
4960 echo "❌ Error : Could not find a server JAR for version $MC_VERSION and type $SERVER_TYPE."
8192 - name : Clean Up Server Files
8293 run : |
8394 echo "🧹 Cleaning up server files..."
84- rm -rf "$HOME/minecraft-server-${{ matrix.mc_version }}-${{ matrix.server_type }}"
95+ rm -rf "$HOME/minecraft-server-${{ matrix.mc_version }}-${{ matrix.server_type }}"
You can’t perform that action at this time.
0 commit comments