Commits

Jan Borsodi committed e97e80d

scope-doc: If the --target option is not supplied by the user it will be read from the project file.

Comments (0)

Files changed (1)

 from hob.utils import _, tempdir
 from hob.extension import ExtensionError
 from hob.cmd import ProgramError
+from hob.proto import Config
 
 cmds = CommandTable()
 
         hob_opts = []
         rst_opts = []
         hob_version = capture(["hob", "--version"])[1].splitlines()[0]
+        project_path = join(abspath(self.service_source_path), "hob.conf")
         if Version(hob_version) > "0.1":
-            hob_opts = ["--project", join(abspath(self.service_source_path), "hob.conf")]
+            hob_opts = ["--project", project_path]
             rst_opts = ["--syntax", self.syntax]
         else:
-            hob_opts = ["--config-file", join(abspath(self.service_source_path), "hob.conf")]
+            hob_opts = ["--config-file", project_path]
+        if not self.target:
+            project_conf = Config()
+            project_conf.read([project_path])
+            if ('hob', 'target') in project_conf:
+                self.target = project_conf[('hob', 'target')]
         if self.target:
             hob_opts += ["--target", self.target]