File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -66,9 +66,14 @@ def process_repo(repo, destination_directory):
66
66
destination_directory ,
67
67
)
68
68
if len (tutorials ) > 1 :
69
- index = glob .glob (f"{ repo } /index-*.html" )[0 ]
70
- print (f"More than 1 tutorial found; also copying index file { index } " )
71
- shutil .copy (index , destination_directory )
69
+ index_files = glob .glob (f"{ repo } /index-*.html" )
70
+ if index_files :
71
+ index = index_files [0 ]
72
+ print (f"More than 1 tutorial found; also copying index file { index } " )
73
+ shutil .copy (index , destination_directory )
74
+ else :
75
+ raise FileNotFoundError (f"No index-*.html file found for { repo_name } ." )
76
+
72
77
# copy images (plots) in notebook for faster page loading
73
78
images = glob .glob (f"{ repo } /_images/*.png" )
74
79
if len (images ) > 0 :
You can’t perform that action at this time.
0 commit comments