From df875b582ff5a14c86eea50f1fc21d16a93668df Mon Sep 17 00:00:00 2001 From: git-afsantos Date: Thu, 19 Aug 2021 15:00:28 +0100 Subject: [PATCH] fixes #70 fixes #111 --- haros/haros.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/haros/haros.py b/haros/haros.py index 6f92b43..aa7f0bb 100644 --- a/haros/haros.py +++ b/haros/haros.py @@ -179,6 +179,7 @@ def launch(self, argv=None): return True self.minimal_output = getattr(args, "minimal_output", False) self._set_directories(args) + self._ensure_haros_home() if args.debug: logging.basicConfig(filename=self.log_path, filemode="w", level=logging.DEBUG) @@ -483,6 +484,13 @@ def _generate_dir(self, path, dir_dict, overwrite=True): os.mkdir(new_path) self._generate_dir(new_path, contents, overwrite=overwrite) + def _ensure_haros_home(self): + self.log.debug("HarosRunner._ensure_haros_home(%s)", self.haros_dir) + if not os.path.isdir(self.haros_dir): + if os.path.isfile(self.haros_dir): + raise RuntimeError("Could not create dir: " + self.haros_dir) + os.makedirs(self.haros_dir) + ############################################################################### # Base Command Runner