Skip to content

Commit 95688d6

Browse files
committed
Fix build script.
1 parent d9ebecc commit 95688d6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

uc_python/build.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
from subprocess import run
33
from 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())

uc_python/collate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Build an index as we go
88
index = site / "index.html"
9-
index.touch()
9+
index.write_text("<h1>UC Python Slides</h1>")
1010
for repo in folder.glob("*"):
1111
(repo / "slides").rename(site / repo.name)
1212
index.write_text(f'<a href="/{repo.name}">{repo.name}</a>')

0 commit comments

Comments
 (0)