-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_resume.sh
executable file
·51 lines (41 loc) · 1.22 KB
/
build_resume.sh
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
#!/bin/bash
set -eu
Now=$(date +"%Y%m%d-%H%M%S")
TexMode="nonstopmode"
Name="ds_resume" # TODO: have this be a CLI arg
Tex="${Name}.tex"
JobName="${Name}_${Now}"
OutDir="./output"
UserId=$(id -u)
GroupId=$(id -g)
# check if "output" dir exists; create if not
if [ ! -d "/path/to/dir" ]; then
echo "# Creating output directory: ${OutDir} ..."
mkdir -p ${OutDir}
fi
# recreate docker image
echo "# Creating image ..."
make build # TODO: add CLI arg for small vs large image
# make build-texlive # larger, pre-compiled image
# generate tex output
echo "# Building tex ..."
./run_tex.sh \
pdflatex \
--interaction=nonstopmode \
--output-dir=${OutDir} \
--jobname=${JobName} \
${Tex} \
|| true # ignore exit code
DatedOutput="${OutDir}/${JobName}.pdf"
LatestFileName="resume_stadther_dillon.pdf"
LatestOutput="${OutDir}/${LatestFileName}"
echo "# Checking existence of ${DatedOutput} ..."
if [[ -f "${DatedOutput}" ]]; then
echo "# Overwriting 'latest' (${LatestOutput}) ..."
cp -f ${DatedOutput} ${LatestOutput}
else
echo "# File did not exist: ${DatedOutput}"
fi
# spell check
# on mac: `brew install aspell`
for f in **/*.tex ; do echo $f ; aspell list < $f | sort | uniq -c ; done