fix: Revised error messages and filename sanitization processing

- Improved error messages within the `find_library_file` function to include directory names
- Organized comments within the `sanitize_filename` function
- Improved error messages within the `split_library` function to include directory names
This commit is contained in:
jun-shiromizu
2026-02-02 10:35:28 +09:00
parent f57435a965
commit a3be150f8e

View File

@@ -65,12 +65,12 @@ def find_library_file(directory: Path) -> Path:
if len(library_files) == 0: if len(library_files) == 0:
print(f"Error: No .excalidrawlib file found in {directory}") print(f"Error: No .excalidrawlib file found in {directory}")
print(f"Please place a .excalidrawlib file in this directory first.") print(f"Please place a .excalidrawlib file in {directory} first.")
sys.exit(1) sys.exit(1)
if len(library_files) > 1: if len(library_files) > 1:
print(f"Error: Multiple .excalidrawlib files found in {directory}") print(f"Error: Multiple .excalidrawlib files found in {directory}")
print(f"Please keep only one library file in the directory.") print(f"Please keep only one library file in {directory}.")
sys.exit(1) sys.exit(1)
return library_files[0] return library_files[0]