Minor cleanup
This commit is contained in:
parent
5b0f22c917
commit
0fb5c3a118
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,6 +4,8 @@ __pycache__
|
|||||||
*-ignore
|
*-ignore
|
||||||
|
|
||||||
# Output files
|
# Output files
|
||||||
|
/output
|
||||||
|
/output.zip
|
||||||
main.pdf
|
main.pdf
|
||||||
**/build
|
**/build
|
||||||
|
|
||||||
|
55
build.sh
Executable file
55
build.sh
Executable file
@ -0,0 +1,55 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
run_dir=$(pwd)
|
||||||
|
target="output"
|
||||||
|
|
||||||
|
rm -drf "${target}"
|
||||||
|
rm -f "output.zip"
|
||||||
|
|
||||||
|
function build() {
|
||||||
|
local doc_dir="$(dirname "${1}")"
|
||||||
|
local main_file="$(basename "${1}")"
|
||||||
|
local job_name="$(basename "${doc_dir}")"
|
||||||
|
|
||||||
|
echo "|> Building ${job_name}..."
|
||||||
|
cd "${doc_dir}"
|
||||||
|
|
||||||
|
tectonic \
|
||||||
|
--outfmt pdf \
|
||||||
|
--chatter minimal \
|
||||||
|
main.tex
|
||||||
|
|
||||||
|
stat=$?
|
||||||
|
|
||||||
|
if [[ $stat == 0 ]]; then
|
||||||
|
mv main.pdf "${OUTPUT}/${job_name}.pdf"
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
rm -f main.pdf
|
||||||
|
echo "|> Build failed"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "${run_dir}"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for d in ./Advanced/*/ ; do
|
||||||
|
doc_dir=$(realpath "${d}")
|
||||||
|
OUTPUT="${run_dir}/${target}/Advanced"
|
||||||
|
mkdir -p "${OUTPUT}"
|
||||||
|
|
||||||
|
build "${doc_dir}/main.tex"
|
||||||
|
done
|
||||||
|
|
||||||
|
for d in ./Intermediate/*/ ; do
|
||||||
|
doc_dir=$(realpath "${d}")
|
||||||
|
OUTPUT="${run_dir}/${target}/Intermediate"
|
||||||
|
mkdir -p "${OUTPUT}"
|
||||||
|
|
||||||
|
build "${doc_dir}/main.tex"
|
||||||
|
done
|
||||||
|
|
||||||
|
ls
|
||||||
|
pwd
|
||||||
|
|
||||||
|
zip -FSrj output.zip "${target}"
|
2
resources/scripts/.gitignore
vendored
2
resources/scripts/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
output
|
|
||||||
output.zip
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
START=$(pwd)
|
|
||||||
OUT_SUBDIR="output"
|
|
||||||
|
|
||||||
function build() {
|
|
||||||
local DIR="$(dirname "${1}")"
|
|
||||||
local MAIN="$(basename "${1}")"
|
|
||||||
local NAME="$(basename "${DIR}")"
|
|
||||||
|
|
||||||
echo "|> Building ${NAME}..."
|
|
||||||
cd "${DIR}"
|
|
||||||
|
|
||||||
tectonic \
|
|
||||||
--outfmt pdf \
|
|
||||||
--chatter minimal \
|
|
||||||
main.tex
|
|
||||||
|
|
||||||
stat=$?
|
|
||||||
|
|
||||||
if [[ $stat == 0 ]]; then
|
|
||||||
mv main.pdf "${OUTPUT}/${NAME}.pdf"
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
rm -f main.pdf
|
|
||||||
echo "|> Build failed"
|
|
||||||
echo ""
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for d in ../../Advanced/*/ ; do
|
|
||||||
DIR=$(realpath "${d}")
|
|
||||||
OUTPUT="${START}/${OUT_SUBDIR}/Advanced"
|
|
||||||
mkdir -p "${OUTPUT}"
|
|
||||||
|
|
||||||
build "${DIR}/main.tex"
|
|
||||||
done
|
|
||||||
|
|
||||||
for d in ../../Intermediate/*/ ; do
|
|
||||||
DIR=$(realpath "${d}")
|
|
||||||
OUTPUT="${START}/${OUT_SUBDIR}/Intermediate"
|
|
||||||
mkdir -p "${OUTPUT}"
|
|
||||||
|
|
||||||
build "${DIR}/main.tex"
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
zip -FSrj output.zip "${OUT_SUBDIR}"/*
|
|
Loading…
x
Reference in New Issue
Block a user