[Fixed][Text variables] when using an empty text

Fixes #268
This commit is contained in:
Salvador E. Tropea 2022-08-31 09:18:19 -03:00
parent 10ee73feeb
commit 49d20fdeeb
2 changed files with 3 additions and 3 deletions

View File

@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Install checker: fixed problems to detect iBoM installed as plugin. (#209)
- Internal Netlist generation (i.e. iBoM with variants): problems withg
components that doesn't specify a library. (See #242)
- Problems when setting a text variable to an empty string. (#268)
### Changed
- The order in which main sections are parsed is now fixed.

View File

@ -116,7 +116,7 @@ class Set_Text_Variables(BasePreFlight): # noqa: F821
os.environ['KIBOT_SCH_NAME'] = GS.sch_file
for r in o:
text = r.text
if not text:
if not text and r.command:
command = r.command
if re_git.search(command):
git_command = self.ensure_tool('git')
@ -127,8 +127,7 @@ class Set_Text_Variables(BasePreFlight): # noqa: F821
logger.error('Failed to execute:\n{}\nreturn code {}'.format(r.command, result.returncode))
sys.exit(FAILED_EXECUTE)
if not result.stdout:
logger.warning(W_EMPTREP+"Empty value from `{}` skipping it".format(r.command))
continue
logger.warning(W_EMPTREP+"Empty value from `{}`".format(r.command))
text = result.stdout.strip()
text = r.before + text + r.after
logger.debug(' - ' + r.name + ' -> ' + text)