Skip to content

Commit 2979ae0

Browse files
Differentiate between missing folder and no lab for module
1 parent 6e4efe4 commit 2979ae0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

support_files/build_labs_folder.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ def safe_copy(source, destination):
7373
return False
7474

7575

76+
def has_lab(filename):
77+
with open(filename) as f:
78+
return "lab.rst" in f.read()
79+
80+
7681
def build_folder(course, destination, ada95, build):
7782

7883
directory = os.path.dirname(course)
@@ -101,7 +106,10 @@ def build_folder(course, destination, ada95, build):
101106
print("Processing " + module[4:])
102107

103108
prompt_source = os.path.join(source_folder, "prompt")
104-
if os.path.exists(prompt_source):
109+
if not has_lab(os.path.join(directory, f)):
110+
print(" No lab")
111+
112+
elif os.path.exists(prompt_source):
105113
os.makedirs(destination_folder, exist_ok=True)
106114

107115
shutil.copytree(

0 commit comments

Comments
 (0)