File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22from subprocess import run
33from pathlib import Path
44
5- folder = Path ("repos" )
5+ folder = Path ("repos" ).absolute ()
6+ repo_paths = [f for f in folder .glob ("*" ) if f .is_dir ()]
67
7- for repo in folder .glob ("*" ):
8- os .chdir (repo )
8+ for repo in repo_paths :
9+ os .chdir (folder / repo )
10+ if not (repo / "Makefile" ).exists ():
11+ print ("no Makefile, skipping" )
12+ continue
913 print (f"building slides for { repo .name } ..." )
1014 run (["make" , "slides" ], check = True )
1115 print ("done" )
12- os .chdir ( ".." )
16+ print ( os .getcwd () )
Original file line number Diff line number Diff line change 66
77# Build an index as we go
88index = site / "index.html"
9- index .touch ( )
9+ index .write_text ( "<h1>UC Python Slides</h1>" )
1010for repo in folder .glob ("*" ):
1111 (repo / "slides" ).rename (site / repo .name )
1212 index .write_text (f'<a href="/{ repo .name } ">{ repo .name } </a>' )
You can’t perform that action at this time.
0 commit comments