File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -558,12 +558,21 @@ if [ "$PRIVATE" = true ]; then
558558fi
559559
560560# create the space if it doesn't exist
561- hf repo create " $SPACE_REPO " --repo-type space --space_sdk docker --exist-ok $PRIVATE_FLAG ${TOKEN_ARGS[@]+" ${TOKEN_ARGS[@]} " } --quiet > /dev/null 2>&1 || true
561+ CREATE_OUTPUT=$( hf repo create " $SPACE_REPO " --repo-type space --space_sdk docker --exist-ok $PRIVATE_FLAG ${TOKEN_ARGS[@]+" ${TOKEN_ARGS[@]} " } 2>&1 )
562+ CREATE_EXIT_CODE=$?
563+ if [ $CREATE_EXIT_CODE -ne 0 ]; then
564+ echo " ⚠️ Space creation returned non-zero exit code" >&2
565+ echo " $CREATE_OUTPUT " >&2
566+ # Continue anyway - space might already exist
567+ fi
562568
563569# upload the staged content (if repo doesn't exist, it will be created with the privacy setting)
564- SPACE_UPLOAD_RESULT=$( hf upload --repo-type=space $PRIVATE_FLAG ${TOKEN_ARGS[@]+" ${TOKEN_ARGS[@]} " } --quiet " $SPACE_REPO " " $CURRENT_STAGING_DIR_ABS " 2>&1 )
565- if [ $? -ne 0 ]; then
566- echo " ❌ Upload failed: $SPACE_UPLOAD_RESULT " >&2
570+ SPACE_UPLOAD_RESULT=$( hf upload --repo-type=space $PRIVATE_FLAG ${TOKEN_ARGS[@]+" ${TOKEN_ARGS[@]} " } " $SPACE_REPO " " $CURRENT_STAGING_DIR_ABS " 2>&1 )
571+ UPLOAD_EXIT_CODE=$?
572+ if [ $UPLOAD_EXIT_CODE -ne 0 ]; then
573+ echo " ❌ Upload failed with exit code $UPLOAD_EXIT_CODE " >&2
574+ echo " Error output:" >&2
575+ echo " $SPACE_UPLOAD_RESULT " >&2
567576 exit 1
568577fi
569578# print the URL of the deployed space
You can’t perform that action at this time.
0 commit comments