From ab07cd6d9222ead90b625668b3e0de669694a5dd Mon Sep 17 00:00:00 2001 From: pratik Date: Wed, 22 Oct 2025 11:55:12 -0500 Subject: [PATCH] fixes --- deploy-chunked.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/deploy-chunked.sh b/deploy-chunked.sh index 223d8e8..bd3a399 100644 --- a/deploy-chunked.sh +++ b/deploy-chunked.sh @@ -158,31 +158,38 @@ if [ "$DEBUG_MODE" = "true" ]; then echo "$CF_CONFIG" fi +# Write JSON to temporary file to avoid quote escaping issues +TEMP_JSON=$(mktemp) +echo "$CF_CONFIG" > "$TEMP_JSON" + # Build the curl command if [ -n "$CURL_OPTS" ]; then if [ "$DEBUG_MODE" = "true" ]; then INIT_RESPONSE=$(eval curl -v -X POST "$API_BASE/upload/init" \ -H "Content-Type: application/json" \ $CURL_OPTS \ - -d "'$CF_CONFIG'") + -d @"$TEMP_JSON") else INIT_RESPONSE=$(eval curl -s -X POST "$API_BASE/upload/init" \ -H "Content-Type: application/json" \ $CURL_OPTS \ - -d "'$CF_CONFIG'") + -d @"$TEMP_JSON") fi else if [ "$DEBUG_MODE" = "true" ]; then INIT_RESPONSE=$(curl -v -X POST "$API_BASE/upload/init" \ -H "Content-Type: application/json" \ - -d "$CF_CONFIG") + -d @"$TEMP_JSON") else INIT_RESPONSE=$(curl -s -X POST "$API_BASE/upload/init" \ -H "Content-Type: application/json" \ - -d "$CF_CONFIG") + -d @"$TEMP_JSON") fi fi +# Clean up temporary file +rm -f "$TEMP_JSON" + CURL_EXIT_CODE=$? if [ "$DEBUG_MODE" = "true" ]; then echo "DEBUG: Curl exit code: $CURL_EXIT_CODE"