From e1f10ac4516f64019204cadfb05dc9fe4b617d35 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Tue, 7 Jul 2020 13:58:04 +0100 Subject: 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. --- reproduce/analysis/make/initialize.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'reproduce') 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 -- cgit v1.2.1