File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111from pathlib import Path
1212
1313RUNS_SUBCOLLECTION = "runs"
14- LOCAL_RUNS_PATH = Path (__file__ ).resolve ().parent .parent / "runs.json"
14+
15+ import sys
16+ if getattr (sys , "frozen" , False ):
17+ _app_support = Path .home () / "Library" / "Application Support" / "Petey"
18+ _app_support .mkdir (parents = True , exist_ok = True )
19+ LOCAL_RUNS_PATH = _app_support / "runs.json"
20+ else :
21+ LOCAL_RUNS_PATH = Path (__file__ ).resolve ().parent .parent / "runs.json"
1522
1623
1724def _use_local () -> bool :
Original file line number Diff line number Diff line change 1919 firestore = None
2020
2121BASE_DIR = Path (__file__ ).resolve ().parent .parent
22- SETTINGS_PATH = BASE_DIR / "settings.json"
22+
23+ # When running as a frozen app (.app bundle), the bundle is read-only.
24+ # Store settings in ~/Library/Application Support/Petey/ instead.
25+ import sys
26+ if getattr (sys , "frozen" , False ):
27+ _app_support = Path .home () / "Library" / "Application Support" / "Petey"
28+ _app_support .mkdir (parents = True , exist_ok = True )
29+ SETTINGS_PATH = _app_support / "settings.json"
30+ else :
31+ SETTINGS_PATH = BASE_DIR / "settings.json"
2332COLLECTION = "user_settings"
2433
2534DEFAULTS = {
You can’t perform that action at this time.
0 commit comments