mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-23 17:58:35 +08:00
fix: add trailing newline to component_index.json (#12545)
The build_component_index.py script was generating component_index.json without a trailing newline, causing CI failures when autofix.ci tried to add the missing newline. This fix ensures the generated JSON file always ends with a newline character, following POSIX text file standards. Fixes the 'No newline at end of file' error in the update-component-index workflow job.
This commit is contained in:
@ -179,7 +179,7 @@ def main():
|
||||
# Pretty-print for readable git diffs and resolvable merge conflicts
|
||||
print(f"\nWriting formatted index to {output_path}")
|
||||
json_bytes = orjson.dumps(index, option=orjson.OPT_SORT_KEYS | orjson.OPT_INDENT_2)
|
||||
output_path.write_text(json_bytes.decode("utf-8"), encoding="utf-8")
|
||||
output_path.write_text(json_bytes.decode("utf-8") + "\n", encoding="utf-8")
|
||||
|
||||
print("\nIndex successfully written!")
|
||||
print(f" Version: {index['version']}")
|
||||
|
||||
Reference in New Issue
Block a user