Skip to content

Commit 4e73836

Browse files
committed
Return all files as text with build success marker in compile-and-fix response
1 parent fb4a11f commit 4e73836

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,11 @@ async def generate_project_sync(request: ProjectRequest):
516516
"build_output": output,
517517
"run_output": run_output if run_success else "Failed to run project"
518518
})
519+
520+
# Return all files as text with build success marker
521+
all_files_content = "\n".join([f"[filename: {f}]\n{open(os.path.join(temp_dir, f)).read()}\n" for f in file_paths])
522+
all_files_content += "\n# Build succeeded\n"
523+
return PlainTextResponse(content=all_files_content)
519524
else:
520525
status.update({
521526
"status": "failed",
@@ -524,9 +529,5 @@ async def generate_project_sync(request: ProjectRequest):
524529
})
525530

526531
save_status(temp_dir, status)
527-
528-
# Return all files as text
529-
all_files_content = "\n".join([f"[filename: {f}]\n{open(os.path.join(temp_dir, f)).read()}\n" for f in file_paths])
530-
return PlainTextResponse(content=all_files_content)
531532
except Exception as e:
532533
raise HTTPException(status_code=500, detail=f"Error generating project: {str(e)}")

0 commit comments

Comments
 (0)