Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ofrak_core/ofrak/core/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ async def initialize_from_disk(
path: str,
):
root_path = os.path.normpath(path)

if not os.path.exists(root_path):
raise FileNotFoundError(
f"Could not initialize from disk. Root path does not exist: {root_path}"
)
if not os.path.isdir(root_path):
raise FileNotFoundError(
f"Could not initialize from disk. Found a file instead of a directory: {root_path}"
)

for root, dirs, files in os.walk(root_path):
for d in sorted(dirs):
absolute_path = os.path.join(root, d)
Expand Down