-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·69 lines (58 loc) · 2.21 KB
/
build.sh
File metadata and controls
executable file
·69 lines (58 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
#-------------------------
# Resume Builder Script
# Builds all resume versions from LaTeX source
# Uses template.tex and defaults.tex as core files
#------------------------
echo "🧹 Cleaning old build artifacts..."
# Remove old PDF files and LaTeX auxiliary files
find . -name "*.pdf" -delete
find . -name "*.aux" -delete
find . -name "*.log" -delete
find . -name "*.out" -delete
find . -name "*.fls" -delete
find . -name "*.fdb_latexmk" -delete
find . -name "*.synctex.gz" -delete
echo "📄 Building all resume versions..."
# Create output directory if it doesn't exist
mkdir -p output
# Automatically detect all .tex files in the variants folder (excluding files starting with _)
resumes=($(find variants -name "*.tex" ! -name "_*.tex" -exec basename {} .tex \;))
# Build each resume from the root directory
for resume in "${resumes[@]}"; do
echo " Building $resume.tex..."
# Compile the variant file directly (it includes defaults.tex and template.tex)
pdflatex -interaction=nonstopmode "variants/$resume.tex" > "${resume}_build.log" 2>&1
# Check if PDF was created (LaTeX can succeed even with warnings)
if [ -f "$resume.pdf" ]; then
echo " ✅ $resume.pdf created successfully"
# Move PDF to output directory
mv "$resume.pdf" "output/$resume.pdf"
# Remove successful build log
rm -f "${resume}_build.log"
else
echo " ❌ Error building $resume.pdf - check ${resume}_build.log for details"
fi
done
echo "🧹 Cleaning up auxiliary files..."
# Remove all LaTeX auxiliary files except PDFs and error logs
find . -name "*.aux" -delete
find . -name "*.log" -delete
find . -name "*.out" -delete
find . -name "*.fls" -delete
find . -name "*.fdb_latexmk" -delete
find . -name "*.synctex.gz" -delete
echo "📊 Build summary:"
echo "Generated PDFs:"
ls -la output/*.pdf 2>/dev/null || echo "No PDFs found"
# Check if there are any error logs
error_logs=$(find . -name "*_build.log" 2>/dev/null)
if [ -n "$error_logs" ]; then
echo ""
echo "⚠️ Error logs found:"
echo "$error_logs"
echo "Check these files for compilation errors."
else
echo ""
echo "🎉 Resume build complete! All PDFs are ready in the output/ directory."
fi