mirror of
https://github.com/storytold/materialcraft.git
synced 2026-11-24 16:31:02 +01:00
An export that collides with a file already in the destination currently overwrites it without warning, losing the existing file. Rejecting the collision before writing protects existing files and makes the failure explicit. Check every target path in the destination directory before creating or writing any output, and return a file.export error naming the colliding filename if one already exists. Add a regression test that places a sentinel file at an output name, runs file.export with unique identifiers, and asserts the export fails and the sentinel is unchanged. Test: export_rejects_existing_file_in_destination_before_writing failed before the change and passes after.