Skip to content

Commit d9a384a

Browse files
Make storage data directory if not exists
1 parent 190d896 commit d9a384a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

custom_components/battery_notes/library.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def _load_library_json(library_file: str) -> dict[str, Any]:
7474
try:
7575
legacy_data_directory = os.path.join(os.path.dirname(__file__), "data")
7676
legacy_json_user_path = os.path.join(legacy_data_directory, user_library_filename)
77+
os.makedirs(os.path.dirname(json_user_path), exist_ok=True)
7778
os.rename(legacy_json_user_path, json_user_path)
7879

7980
_LOGGER.debug(

0 commit comments

Comments
 (0)