File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,7 @@ def clear_cache():
251251@app .cli .command ()
252252@click .argument ("pattern" )
253253def update_docs (pattern = "*" ):
254+ Path ("/data/images" ).mkdir (parents = True , exist_ok = True )
254255 # only add documents that are not already entered
255256 for pdf_path in Path ("/data" + "/pdfs" ).glob (pattern + ".pdf" ):
256257 try :
@@ -290,6 +291,7 @@ def clear_data():
290291 db .create_all ()
291292 db .session .commit ()
292293
294+ Path ("/data/images" ).mkdir (parents = True , exist_ok = True )
293295 for pdf_path in Path ("/data/pdfs" ).glob ("*.pdf" ):
294296 proc_pdf (pdf_path )
295297
@@ -299,6 +301,7 @@ def clear_data():
299301@click .option ("--force" , is_flag = True , help = "Regenerate existing images" )
300302def generate_images (pattern = "*" , force = False ):
301303 """Generate JPEG and AVIF images from PDFs. Usage: flask generate-images '*'"""
304+ Path ("/data/images" ).mkdir (parents = True , exist_ok = True )
302305 for pdf_path in sorted (Path ("/data/pdfs" ).glob (pattern + ".pdf" )):
303306 if (
304307 pdf_path .stem .endswith ("_en" )
You can’t perform that action at this time.
0 commit comments