From 33dda2c3ac089b1ac3c18eb7caeca186fad505e0 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 7 Sep 2022 13:26:06 -0300 Subject: [PATCH] [Quick Start] Avoid starting a browser when no index is generated --- kibot/kiplot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kibot/kiplot.py b/kibot/kiplot.py index 3a444866..5241bfdb 100644 --- a/kibot/kiplot.py +++ b/kibot/kiplot.py @@ -950,8 +950,9 @@ def generate_examples(start_dir, dry, types): GS.debug_level = old_lvl logger.info('') # Try to open a browser - if os.environ.get('DISPLAY') and which('x-www-browser'): - Popen(['x-www-browser', os.path.join(GS.out_dir, 'index.html')]) + index = os.path.join(GS.out_dir, 'index.html') + if os.environ.get('DISPLAY') and which('x-www-browser') and os.path.isfile(index): + Popen(['x-www-browser', index]) # To avoid circular dependencies: Optionable needs it, but almost everything needs Optionable