Fixed run_erc and run_drc makefile targets.

When the schematic and board aren't loaded.
This commit is contained in:
Salvador E. Tropea 2021-01-29 09:25:56 -03:00
parent 6965d73c4e
commit 0dbb180cb7
2 changed files with 2 additions and 3 deletions

View File

@ -28,12 +28,11 @@ class Run_DRC(BasePreFlight): # noqa: F821
def get_targets(self):
""" Returns a list of targets generated by this preflight """
load_board()
return [Optionable.expand_filename(None, GS.out_dir, GS.def_global_output, 'drc', 'txt')]
def run(self):
check_script(CMD_PCBNEW_RUN_DRC, URL_PCBNEW_RUN_DRC, '1.4.0')
if GS.board is None:
load_board()
output = self.get_targets()[0]
logger.debug('DRC report: '+output)
cmd = [CMD_PCBNEW_RUN_DRC, 'run_drc', '-o', output]

View File

@ -28,13 +28,13 @@ class Run_ERC(BasePreFlight): # noqa: F821
def get_targets(self):
""" Returns a list of targets generated by this preflight """
load_sch()
return [Optionable.expand_filename_sch(None, GS.out_dir, GS.def_global_output, 'erc', 'txt')]
def run(self):
check_eeschema_do()
# The schematic is loaded only before executing an output related to it.
# But here we need data from it.
load_sch()
output = self.get_targets()[0]
logger.debug('ERC report: '+output)
cmd = [CMD_EESCHEMA_DO, 'run_erc', '-o', output]