From: Shane Jaroch Date: Sun, 25 Feb 2024 16:45:32 +0000 (-0500) Subject: fix no such file error X-Git-Tag: v0.2.8.dev0~26 X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=d2d2910276ece019f65e43be667d558078618867;p=nutratech%2Fcli.git fix no such file error --- diff --git a/ntclient/persistence/__init__.py b/ntclient/persistence/__init__.py index 48f780c..167bf13 100644 --- a/ntclient/persistence/__init__.py +++ b/ntclient/persistence/__init__.py @@ -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: