diff --git a/dump_things_pyclient/commands/dtc_plugins/auto_curate.py b/dump_things_pyclient/commands/dtc_plugins/auto_curate.py index 78c8c86..6f055b2 100644 --- a/dump_things_pyclient/commands/dtc_plugins/auto_curate.py +++ b/dump_things_pyclient/commands/dtc_plugins/auto_curate.py @@ -639,7 +639,12 @@ def _update_change_set( console.print(f'[DRY_RUN]:STORE existing record [green]"{record["pid"]}"[/green] of class "{class_name}" from curated area at "{file_path.resolve()}"') else: file_path.write_text( - json.dumps(existing_record, ensure_ascii=False, indent=2) + '\n', + json.dumps( + existing_record, + ensure_ascii=False, + indent=2, + sort_keys=True, + ) + '\n', encoding='utf8' ) else: @@ -672,7 +677,11 @@ def _update_change_set( console.print(f'[DRY_RUN]:STORE annotations for record [green]"{record["pid"]}"[/green] of class "{class_name}" from curated area at "{annotation_path.resolve()}"') else: annotation_path.write_text( - json.dumps(annotations, ensure_ascii=False) + '\n', + json.dumps( + annotations, + ensure_ascii=False, + sort_keys=True, + ) + '\n', encoding='utf8' )