]> Nutra Git (v1) - nutratech/cli.git/commitdiff
fix no such file error
authorShane Jaroch <chown_tee@proton.me>
Sun, 25 Feb 2024 16:45:32 +0000 (11:45 -0500)
committerShane Jaroch <chown_tee@proton.me>
Sun, 25 Feb 2024 16:45:32 +0000 (11:45 -0500)
ntclient/persistence/__init__.py

index 48f780c6f3c6bee766459c8b985cb3d8f0fb8d68..167bf1342f2de9536bf05769fcd036e9afb8f18f 100644 (file)
@@ -17,7 +17,9 @@ from ntclient import NUTRA_HOME
 
 PREFS_FILE = os.path.join(NUTRA_HOME, "prefs.ini")
 
-if not os.path.exists(PREFS_FILE):
+os.makedirs(NUTRA_HOME, 0o755, exist_ok=True)
+
+if not os.path.isfile(PREFS_FILE):
     print("INFO: Generating prefs.ini file")
     config = configparser.ConfigParser()
     with open(PREFS_FILE, "w", encoding="utf-8") as _prefs_file: