Files
owen_scalapino_free_energy/do.sh
2021-01-04 14:31:32 -06:00

42 lines
819 B
Bash

#!/usr/bin/env sh
# Do - The Simplest Build Tool on Earth.
# Documentation and examples see https://github.com/8gears/do
set -Eeuo pipefail # -e "Automatic exit from bash shell script on error" -u "Treat unset variables and parameters as errors"
build() {
echo "I am ${FUNCNAME[0]}ing"
_makefigures
latexmk -pdflatex="luahblatex %O %S" -pdf -dvi- -ps- -quiet -logfilewarninglist
}
_makefigdir() {
mkdir -p figures
}
_makefigures() {
_makefigdir
wolframscript -f scripts/fig1.wls
}
all() {
build
}
clean() {
echo "I am ${FUNCNAME[0]}ing"
latexmk -C
rm -f *.bbl *.run.xml
rm -f figures
}
tidy() {
echo "I am ${FUNCNAME[0]}ing"
latexmk -c
}
"$@" # <- execute the task
[ "$#" -gt 0 ] || printf "Usage:\n\t./do.sh %s\n" "($(compgen -A function | grep '^[^_]' | paste -sd '|' -))"