|
|
@ -83,6 +83,35 @@ if [ $# -eq 1 ]; then
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### Special treatment for thesis
|
|
|
|
|
|
|
|
# If $jobname is thesis, fetch some external assets
|
|
|
|
|
|
|
|
if [[ ${PWD} == "/media/bay/taha/chepec/thesis" && $jobname == "thesis" ]]; then
|
|
|
|
|
|
|
|
echo "<cheRTeX> -------------------------------"
|
|
|
|
|
|
|
|
echo "<cheRTeX> THESIS: getting external assets"
|
|
|
|
|
|
|
|
echo "<cheRTeX> -------------------------------"
|
|
|
|
|
|
|
|
# summary of operations in this if-clause:
|
|
|
|
|
|
|
|
# trawl the assets/ subdirectories looking for a file "external.assets", if found,
|
|
|
|
|
|
|
|
# read its contents line-by-line (each line is a path) and copy that file to the current assets/ subdir
|
|
|
|
|
|
|
|
# note that we only look for assets.external inside the subdirectories, and not in assets/ itself
|
|
|
|
|
|
|
|
assetsubdirectories="$(find /media/bay/taha/chepec/thesis/assets/ -maxdepth 1 -mindepth 1 -type d)"
|
|
|
|
|
|
|
|
# loop through $assetdirs, and look for the file external.assets in each path
|
|
|
|
|
|
|
|
for assetdir in $assetsubdirectories; do
|
|
|
|
|
|
|
|
assetfilename="assets.external"
|
|
|
|
|
|
|
|
if [ -e ${assetdir}/${assetfilename} ]; then
|
|
|
|
|
|
|
|
# https://stackoverflow.com/questions/10929453/read-a-file-line-by-line-assigning-the-value-to-a-variable
|
|
|
|
|
|
|
|
# $assets is the current assets.external file
|
|
|
|
|
|
|
|
assets="${assetdir}/${assetfilename}"
|
|
|
|
|
|
|
|
while IFS='' read -r asset || [[ -n "$asset" ]]; do
|
|
|
|
|
|
|
|
echo "$asset"
|
|
|
|
|
|
|
|
# copy this filepath into the current assets subdirectory
|
|
|
|
|
|
|
|
cp --preserve=timestamps $asset $assetdir
|
|
|
|
|
|
|
|
done < "$assets"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
# short delay to enable on-screen reading of previous echo
|
|
|
|
|
|
|
|
simpledelay.sh 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Handle knitr or pgfSweave jobs (each requires separate treatment)
|
|
|
|
## Handle knitr or pgfSweave jobs (each requires separate treatment)
|
|
|
|
## But how should we tell the difference between them?
|
|
|
|
## But how should we tell the difference between them?
|
|
|
|