mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
fail if picture doesn't exist
This commit is contained in:
+12
-4
@@ -42,12 +42,20 @@ def create_pdf(yaml):
|
|||||||
# handle pictures
|
# handle pictures
|
||||||
yaml['picture_link'] = ''
|
yaml['picture_link'] = ''
|
||||||
if yaml['picture']:
|
if yaml['picture']:
|
||||||
# skip SVG for now, not supported by pandoc
|
|
||||||
picture_name = yaml['picture']
|
picture_name = yaml['picture']
|
||||||
if 'svg' not in picture_name:
|
|
||||||
yaml['picture_link'] = ''.format(picture_name)
|
# check it's actually there
|
||||||
else:
|
if not os.path.exists(picture_name):
|
||||||
|
logging.warning(f"picture {picture_name} not found")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
# and not SVG
|
||||||
|
if picture_name.endswith('.svg'):
|
||||||
logging.warning("svg not supported")
|
logging.warning("svg not supported")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
# create the link
|
||||||
|
yaml['picture_link'] = ''.format(picture_name)
|
||||||
|
|
||||||
# now build the doc & print it
|
# now build the doc & print it
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user