From 2b54d8320a199217b59d77d8a564c9c412f98969 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Fri, 2 Sep 2022 07:00:01 -0300 Subject: [PATCH] [Diff] Added check for the old/new files specified. --- kibot/out_diff.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kibot/out_diff.py b/kibot/out_diff.py index 5086dce5..f5be7a68 100644 --- a/kibot/out_diff.py +++ b/kibot/out_diff.py @@ -124,7 +124,10 @@ class DiffOptions(BaseOptions): run_command(cmd) def cache_pcb(self, name): - if not name: + if name: + if not os.path.isfile(name): + raise KiPlotConfigurationError('Missing file to compare: `{}`'.format(name)) + else: GS.check_pcb() name = GS.pcb_file hash = self.get_digest(name) @@ -132,7 +135,10 @@ class DiffOptions(BaseOptions): return hash def cache_sch(self, name): - if not name: + if name: + if not os.path.isfile(name): + raise KiPlotConfigurationError('Missing file to compare: `{}`'.format(name)) + else: GS.check_sch() name = GS.sch_file # Schematics can have sub-sheets