aboutsummaryrefslogtreecommitdiff
path: root/reproduce
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2020-07-07 13:58:04 +0100
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2020-07-07 13:58:04 +0100
commite1f10ac4516f64019204cadfb05dc9fe4b617d35 (patch)
tree6ff230448615d782a614472cbfdfd8b4aa0c83a1 /reproduce
parent0e4d4b357f4c2209aea8012847b1309fe8b33b13 (diff)
Project distribution tarball can account for no PDFs in tex/tikz
Until now the './project make dist' command implicitly assumed that the 'tex/tikz' directory always contains PDF files (because of the 'cp tex/tikz/*.pdf $$dir/tex/tikz' line). This was annoying for projects that don't use TiKZ or PGFPlots to generate their plots, and they had to manually comment this line. With this commit a check has been placed to see if any PDF files exist in there at all. If there aren't PDF files, the 'cp' command above is ignored.
Diffstat (limited to 'reproduce')
-rw-r--r--reproduce/analysis/make/initialize.mk7
1 files changed, 6 insertions, 1 deletions
diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk
index dff5eca..29cd2dc 100644
--- a/reproduce/analysis/make/initialize.mk
+++ b/reproduce/analysis/make/initialize.mk
@@ -304,10 +304,15 @@ $(project-package-contents): paper.pdf | $(texdir)
# Copy all the necessary `reproduce' and `tex' contents.
shopt -s extglob
cp -r tex/src $$dir/tex/src
- cp tex/tikz/*.pdf $$dir/tex/tikz
cp -r reproduce/* $$dir/reproduce
cp -r tex/build/!($(project-package-name)) $$dir/tex/build
+ # If the project has any PDFs in its 'tex/tikz' directory (TiKZ or
+ # PGFPlots was used to generate them), copy them too.
+ if ls tex/tikz/*.pdf &> /dev/null; then
+ cp tex/tikz/*.pdf $$dir/tex/tikz
+ fi
+
# Clean up un-necessary/local files: 1) the $(texdir)/build*
# directories (when building in a group structure, there will be
# `build-user1', `build-user2' and etc), are just temporary LaTeX