From 6c8fdb8521222254379cebf4dbd50d13d07adb81 Mon Sep 17 00:00:00 2001 From: Keyboard Slayer Date: Mon, 6 Feb 2023 19:25:47 +0100 Subject: [PATCH] fix: create .osdk directory at first start When launching osdk for the first time, the `.osdk` directory is not present on the project directory. This fix create the directory if it's not present. --- osdk/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osdk/__init__.py b/osdk/__init__.py index 1641d37..a9a58e2 100644 --- a/osdk/__init__.py +++ b/osdk/__init__.py @@ -1,6 +1,7 @@ import sys -from osdk import const +from os.path import isdir +from osdk import const, shell from osdk.args import parse from osdk.cmds import exec, usage from osdk.plugins import loadAll @@ -11,6 +12,8 @@ def main() -> int: a = parse(sys.argv[1:]) if not a.consumeOpt("verbose", False): + if not isdir(const.OSDK_DIR): + shell.mkdir(const.OSDK_DIR) sys.stderr = open(f"{const.OSDK_DIR}/osdk.log", "w") try: