fix bug with version info

This commit is contained in:
Maximilian Keßler 2022-02-08 00:24:25 +01:00
parent 7d8f33294f
commit b53b3be39a
2 changed files with 9 additions and 4 deletions

View file

@ -49,9 +49,13 @@ class PyTeXBuilder:
@property @property
def version_info(self): def version_info(self):
if self._version_info is None: if self._version_info is None:
self._version_info = FileVersionInfo.from_json( version_info_file = self.target_root / VERSION_INFO_FILE
self.target_root / VERSION_INFO_FILE if version_info_file.exists():
) self._version_info = FileVersionInfo.from_json(
self.target_root / VERSION_INFO_FILE
)
else:
self._version_info = FileVersionInfo()
return self._version_info return self._version_info
@property @property
@ -127,5 +131,4 @@ class PyTeXBuilder:
def _build(self): def _build(self):
logger.info("Starting build") logger.info("Starting build")
self.load_pytex_files() self.load_pytex_files()
raise NotImplementedError

View file

@ -53,4 +53,6 @@ builder = PyTeXBuilder(conf_path)
builder.build_tex_sources() builder.build_tex_sources()
v = builder.version_info
pass pass