The current assets.external implementation cannot handle empty lines.

Added a comment to warn about that.
master
Taha Ahmed 5 years ago
parent 32fa1b848f
commit 482ba40ede

@ -35,8 +35,8 @@ Rfiletype="R"
TeXfiletype="tex" TeXfiletype="tex"
tikzfiles="*.tikz" tikzfiles="*.tikz"
Rnwfiles="*.Rnw" Rnwfiles="*.Rnw"
auxfiles="*.acn *.acr *.alg *.aux *.bbl *.bcf *.blg *.dep *.dpth *.fdb* *.figlist *.fls *.glg auxfiles="*.acn *.acr *.alg *.aux *.bbl *.bcf *.blg *.dep *.dpth *.fdb* *.figlist *.fls *.glg
*.glo *.gls *.lof *.log *.lor *.los *.lot *.out *.lox *.makefile *.map *.out *.run* *.slg *.slo *.glo *.gls *.lof *.log *.lor *.los *.lot *.out *.lox *.makefile *.map *.out *.run* *.slg *.slo
*.sls *.tdo *.toc *.xdy" *.sls *.tdo *.toc *.xdy"
@ -89,12 +89,13 @@ if [ $# -eq 1 ]; then
#### Special treatment for thesis #### Special treatment for thesis
if [[ ${PWD} == "/media/bay/taha/chepec/thesis" && $jobname == "thesis" ]]; then if [[ ${PWD} == "/media/bay/taha/chepec/thesis" && $jobname == "thesis" ]]; then
# Fetch external assets by reading any assets.external files in assets/ tree # Fetch external assets by reading any assets.external files in assets/ tree
# NOTE: be careful NOT to leave empty lines in your assets.external files
echo "<thesis> -------------------------------" echo "<thesis> -------------------------------"
echo "<thesis> Getting external assets" echo "<thesis> Getting external assets"
echo "<thesis> -------------------------------" echo "<thesis> -------------------------------"
# summary of operations in this if-clause: # summary of operations in this if-clause:
# trawl the assets/ subdirectories looking for a file "external.assets", if found, # 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 # read its contents line-by-line (each line is a path) and copy that file at that path to the current assets/ subdir
# note that we only look for assets.external inside the subdirectories, and not in assets/ itself # 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)" 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 # loop through $assetdirs, and look for the file external.assets in each path
@ -116,10 +117,10 @@ if [ $# -eq 1 ]; then
echo "<thesis> -------------------------------" echo "<thesis> -------------------------------"
echo "<thesis> Create low-res photos tree" echo "<thesis> Create low-res photos tree"
echo "<thesis> -------------------------------" echo "<thesis> -------------------------------"
# copy existing photos to assets/photos/.lowres/ path # copy existing photos to assets/photos/.lowres/ path
# to save time, rsync only if highres photo has more recent timestamp (otherwise, keep lowres photo without overwriting) # to save time, rsync only if highres photo has more recent timestamp (otherwise, keep lowres photo without overwriting)
# Note: rsync usually looks at file timestamp and size, and if either has changed, copies the file (simplified explanation) # Note: rsync usually looks at file timestamp and size, and if either has changed, copies the file (simplified explanation)
# in this case, I'd like rsync to only compare timestamps and disregard size # in this case, I'd like rsync to only compare timestamps and disregard size
# rsync can't do that. We need to use a different tool. See e.g. # rsync can't do that. We need to use a different tool. See e.g.
# https://superuser.com/questions/260092/rsync-switch-to-only-compare-timestamps # https://superuser.com/questions/260092/rsync-switch-to-only-compare-timestamps
# copy only the "large" photos that have file modtimes more recent than the last time this operation was run # copy only the "large" photos that have file modtimes more recent than the last time this operation was run

Loading…
Cancel
Save