Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.
Closed
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
14 changes: 14 additions & 0 deletions RomM/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def __init__(self) -> None:
base_path = os.path.abspath(os.path.join(os.getcwd(), "..", ".."))
# Default to the ROMs directory, overridable via environment variable
self._sd1_roms_storage_path = os.environ.get("ROMS_STORAGE_PATH", base_path)
# For non-MuOS/non-SpruceOS devices, use catalogue from environment or create one in the app directory
self._sd1_catalogue_path = os.environ.get(
"CATALOGUE_PATH",
os.path.join(os.getcwd(), "catalogue")
)

# Ensure the ROMs storage path exists
if self._sd2_roms_storage_path and not os.path.exists(
Expand All @@ -56,6 +61,15 @@ def __init__(self) -> None:
except FileNotFoundError:
print("Cannot create SD2 storage path", self._sd2_roms_storage_path)

# Ensure the catalogue path exists
if self._sd1_catalogue_path and not os.path.exists(self._sd1_catalogue_path):
try:
os.makedirs(self._sd1_catalogue_path, exist_ok=True)
print(f"Created catalogue directory: {self._sd1_catalogue_path}")
except Exception as e:
print(f"Cannot create catalogue directory {self._sd1_catalogue_path}: {e}")
self._sd1_catalogue_path = None

# Set the default SD card based on the existence of the storage path
self._current_sd = int(
os.getenv(
Expand Down
Loading