From 62b8983f25805829cdd02fbc3204cd7676a3e6fc Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Fri, 29 May 2020 02:48:25 +0100 Subject: pdftotext only called if present in system, minor edit David and Raul had both reported that because 'pdftotext' wasn't available on their system, the project failed (even though the PDF was built!). So with this commit, we first check if the system has 'pdftotext' and call it only if its is available. Some minor edits were made, building upon Boud's previous commit. --- project | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'project') diff --git a/project b/project index 47cb5ae..1d7847a 100755 --- a/project +++ b/project @@ -407,10 +407,12 @@ EOF # Run the actual project. controlled_env reproduce/analysis/make/top-make.mk - # Print the number of words - numwords=$(/usr/bin/pdftotext paper.pdf && cat paper.txt | wc -w) - echo; echo "Number of words in full PDF: $numwords" - rm paper.txt + # Print the number of words (if the user has pdftotext. + if which pdftotext &> /dev/null; then + numwords=$(pdftotext paper.pdf && cat paper.txt | wc -w) + echo; echo "Number of words in full PDF: $numwords" + rm paper.txt + fi ;; -- cgit v1.2.1