From 20a32f65a650aa259702d5d75ccf5161fbe46ad1 Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Fri, 18 Jul 2025 15:33:23 -0300 Subject: [PATCH] check for layout files existence before writing --- src/OcflStorageService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/OcflStorageService.php b/src/OcflStorageService.php index 7835d0b..e493ca8 100644 --- a/src/OcflStorageService.php +++ b/src/OcflStorageService.php @@ -175,7 +175,9 @@ class OcflStorageService { // Create the OCFL root indicator file if it doesn't exist. $ocfl_root_indicator_path = $this->ocflRoot . '/.ocfl_layout'; - $this->fileSystem->saveData('ocfl_layout_1.0', $ocfl_root_indicator_path,FileExists::Error); + if(!file_exists($ocfl_root_indicator_path)) { + $this->fileSystem->saveData('ocfl_layout_1.0', $ocfl_root_indicator_path, FileExists::Error); + } }