@@ -296,26 +296,27 @@ def jupyterlite_build(app: Sphinx, error):
296296 print ("[jupyterlite-sphinx] Running JupyterLite build" )
297297 jupyterlite_config = app .env .config .jupyterlite_config
298298 jupyterlite_contents = app .env .config .jupyterlite_contents
299- if jupyterlite_contents is not None :
300- jupyterlite_contents = [
301- match
302- for pattern in jupyterlite_contents
303- for match in glob .glob (pattern , recursive = True )
304- ]
305299 jupyterlite_dir = app .env .config .jupyterlite_dir
306300
307301 config = []
308302 if jupyterlite_config :
309303 config = ["--config" , jupyterlite_config ]
310304
311- contents = []
312- if jupyterlite_contents :
313- if isinstance (jupyterlite_contents , str ):
314- contents .extend (["--contents" , jupyterlite_contents ])
305+ if jupyterlite_contents is None :
306+ jupyterlite_contents = []
307+ elif isinstance (jupyterlite_contents , str ):
308+ jupyterlite_contents = [jupyterlite_contents ]
309+
310+ # Expand globs in the contents strings
311+ jupyterlite_contents = [
312+ match
313+ for pattern in jupyterlite_contents
314+ for match in glob .glob (pattern , recursive = True )
315+ ]
315316
316- if isinstance ( jupyterlite_contents , ( tuple , list )):
317- for content in jupyterlite_contents :
318- contents .extend (["--contents" , content ])
317+ contents = []
318+ for content in jupyterlite_contents :
319+ contents .extend (["--contents" , content ])
319320
320321 command = [
321322 "jupyter" ,
0 commit comments