Finish up lab3
This commit is contained in:
@ -9,15 +9,15 @@ cd /labs || { echo "Error: /labs directory not found in container. Exiting."; ex
|
||||
# Find all directories prefixed with "lab-"
|
||||
find . -maxdepth 1 -type d -name "lab-*" | while read lab_dir; do
|
||||
echo "Processing directory: $lab_dir"
|
||||
markdown_file="$lab_dir/LAB-REPORT.md"
|
||||
pdf_file="$lab_dir/LAB-REPORT.pdf"
|
||||
markdown_file="$lab_dir/README.md"
|
||||
pdf_file="$lab_dir/README.pdf"
|
||||
|
||||
# Check if LAB-REPORT.md exists
|
||||
if [ -f "$markdown_file" ]; then
|
||||
echo "Found $markdown_file"
|
||||
# Check if LAB-REPORT.pdf does not exist
|
||||
if [ ! -f "$pdf_file" ]; then
|
||||
echo "LAB-REPORT.pdf not found. Generating PDF from markdown..."
|
||||
echo "README.pdf not found. Generating PDF from markdown..."
|
||||
# Generate PDF using pandoc
|
||||
# Make sure 'pandoc' command is available in the image, which it is for pandoc/latex
|
||||
image_dir="$lab_dir"
|
||||
@ -29,10 +29,10 @@ find . -maxdepth 1 -type d -name "lab-*" | while read lab_dir; do
|
||||
echo "Error generating $pdf_file"
|
||||
fi
|
||||
else
|
||||
echo "LAB-REPORT.pdf already exists. Skipping generation."
|
||||
echo "README.pdf already exists. Skipping generation."
|
||||
fi
|
||||
else
|
||||
echo "LAB-REPORT.md not found in $lab_dir. Skipping."
|
||||
echo "README.md not found in $lab_dir. Skipping."
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user