Skip to content

Commit 012abfb

Browse files
author
William Yang
committed
fix: BOOTCS_CHECKS_PATH should include language subdirectory
Checks are stored as checks/{language}/{stage}, e.g., checks/c/hello. Updated find_check_dir() to search with language prefix first.
1 parent f131b79 commit 012abfb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

bootcs/__main__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,19 @@ def find_check_dir(slug, language: str = "c", force_update: bool = False):
323323
# 1. Check environment variable first (used by evaluator)
324324
if "BOOTCS_CHECKS_PATH" in os.environ:
325325
checks_path = Path(os.environ["BOOTCS_CHECKS_PATH"])
326-
# Try with stage name directly
326+
# Try with language/stage structure (e.g., checks/c/hello)
327+
path = checks_path / language / stage_name
328+
if path.exists():
329+
return path
330+
# Try with full slug under language
331+
if course_slug:
332+
path = checks_path / language / slug
333+
if path.exists():
334+
return path
335+
# Fallback: try without language prefix
327336
path = checks_path / stage_name
328337
if path.exists():
329338
return path
330-
# Try with full slug
331339
if course_slug:
332340
path = checks_path / slug
333341
if path.exists():

0 commit comments

Comments
 (0)