files in assets/references/ actually need to be overwritten

since they are bibtex libraries which often change on disk
and this copying is how we update the thesis's copy of them
master
Taha Ahmed 4 years ago
parent 52f8fb5ea8
commit d6866b7832

@ -138,9 +138,15 @@ if [ $# -eq 1 ]; then
# https://stackoverflow.com/questions/10929453/read-a-file-line-by-line-assigning-the-value-to-a-variable
while IFS='' read -r asset || [[ -n "$asset" ]]; do
assetpathtarget=$(dirname "$externalfilepath")
echo "Copying $asset to $assetpathtarget"
# cp but don't overwwrite existing files
echo "<thesis> Copying $asset to $assetpathtarget"
# cp but don't overwrite existing files
cp --preserve=timestamps --no-clobber $asset $assetpathtarget
# except we want to overwrite the BibTeX library files (inside the assets/references/ directory), we'll do that by checking the target dirname and only running the destructive cp operation if its "references"
assetdirnametarget=$(basename "$assetpathtarget")
if [[ $assetdirnametarget == "references" ]]; then
echo "<thesis> Overwriting BibTeX libraries in assets/references/"
cp --preserve=timestamps $asset $assetpathtarget
fi
done < "$externalfilepath"
done

Loading…
Cancel
Save